Views
No views yet
1
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4model_path = "PATH_TO_THIS_REPO"
5
6tokenizer = AutoTokenizer.from_pretrained(model_path)
7model = AutoModelForCausalLM.from_pretrained(
8 model_path,
9 device_map="auto",
10 torch_dtype='auto'
11).eval()
12
13# Prompt content: "hi"
14messages = [
15 {"role": "user", "content": Rust_Smart_COntract}
16]
17
18input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt')
19output_ids = model.generate(input_ids.to('cuda'))
20response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
21
22# Model response: "-- Vulnerabilities --"
23print(response)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.