Update README.md
Browse files
README.md
CHANGED
@@ -17,6 +17,34 @@ tags:
|
|
17 |
- **License**: apache-2.0
|
18 |
- **Language**: en
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
# L3_8B_Solana_Smart_Contract_Analyser
|
21 |
|
22 |
L3_8B_Solana_Smart_Contract_Analyser is a cutting-edge AI model designed for comprehensive analysis and security auditing of smart contracts on the Solana blockchain. We utilized the `ArmurAI/L3_8B` base model, enhanced it with extensive knowledge of Solana-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": Rust_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: "-- Vulnerabilities --"
|
45 |
+
print(response)
|
46 |
+
```
|
47 |
+
|
48 |
# L3_8B_Solana_Smart_Contract_Analyser
|
49 |
|
50 |
L3_8B_Solana_Smart_Contract_Analyser is a cutting-edge AI model designed for comprehensive analysis and security auditing of smart contracts on the Solana blockchain. We utilized the `ArmurAI/L3_8B` base model, enhanced it with extensive knowledge of Solana-specific vulnerabilities and best practices, and fine-tuned it with a vast dataset of both secure and vulnerable smart contracts.
|