SoumilB7 commited on
Commit
75f70c0
1 Parent(s): 3dfbe55

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -0
README.md CHANGED
@@ -17,6 +17,34 @@ tags:
17
  - **License**: apache-2.0
18
  - **language**: en
19
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  # L3_8B_Aptos_Smart_Contract_Analyser
21
 
22
  L3_8B_Aptos_Smart_Contract_Analyser is a cutting-edge AI model designed for comprehensive analysis and security auditing of smart contracts on the Aptos blockchain. We utilized the `ArmurAI/L3_8B` base model, enhanced it with extensive knowledge of Aptos-specific vulnerabilities and best practices, and fine-tuned it with a vast dataset of both secure and vulnerable smart contracts.
 
17
  - **License**: apache-2.0
18
  - **language**: en
19
 
20
+ # Usage
21
+
22
+ ```python
23
+
24
+ from transformers import AutoModelForCausalLM, AutoTokenizer
25
+
26
+ model_path = "PATH_TO_THIS_REPO"
27
+
28
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
29
+ model = AutoModelForCausalLM.from_pretrained(
30
+ model_path,
31
+ device_map="auto",
32
+ torch_dtype='auto'
33
+ ).eval()
34
+
35
+ # Prompt content: "hi"
36
+ messages = [
37
+ {"role": "user", "content": Move_Smart_Contract}
38
+ ]
39
+
40
+ input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
41
+ output_ids = model.generate(input_ids.to('cuda'))
42
+ response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
43
+
44
+ # Model response: "-- Vulnerabilites --"
45
+ print(response)
46
+ ```
47
+
48
  # L3_8B_Aptos_Smart_Contract_Analyser
49
 
50
  L3_8B_Aptos_Smart_Contract_Analyser is a cutting-edge AI model designed for comprehensive analysis and security auditing of smart contracts on the Aptos blockchain. We utilized the `ArmurAI/L3_8B` base model, enhanced it with extensive knowledge of Aptos-specific vulnerabilities and best practices, and fine-tuned it with a vast dataset of both secure and vulnerable smart contracts.