FrancescoPeriti
commited on
Commit
•
517ddd6
1
Parent(s):
53c910a
Update README.md
Browse files
README.md
CHANGED
@@ -28,7 +28,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer, AddedToken
|
|
28 |
|
29 |
login("[YOUR HF TOKEN HERE FOR USING LLAMA]")
|
30 |
config = PeftConfig.from_pretrained("ChangeIsKey/llama-7b-lexical-substitution")
|
31 |
-
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-hf")
|
32 |
|
33 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf", use_fast=False, trust_remote_code=True)
|
34 |
tokenizer.add_special_tokens({ "additional_special_tokens":[AddedToken("<|s|>"), AddedToken("<|answer|>"), AddedToken("<|end|>")]})
|
@@ -38,4 +38,5 @@ tokenizer.padding_side = 'left'
|
|
38 |
base_model.resize_token_embeddings(len(tokenizer))
|
39 |
|
40 |
model = PeftModel.from_pretrained(base_model, "ChangeIsKey/llama-7b-lexical-substitution")
|
|
|
41 |
```
|
|
|
28 |
|
29 |
login("[YOUR HF TOKEN HERE FOR USING LLAMA]")
|
30 |
config = PeftConfig.from_pretrained("ChangeIsKey/llama-7b-lexical-substitution")
|
31 |
+
base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-hf", device_map='auto')
|
32 |
|
33 |
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Llama-2-7b-hf", use_fast=False, trust_remote_code=True)
|
34 |
tokenizer.add_special_tokens({ "additional_special_tokens":[AddedToken("<|s|>"), AddedToken("<|answer|>"), AddedToken("<|end|>")]})
|
|
|
38 |
base_model.resize_token_embeddings(len(tokenizer))
|
39 |
|
40 |
model = PeftModel.from_pretrained(base_model, "ChangeIsKey/llama-7b-lexical-substitution")
|
41 |
+
model.eval()
|
42 |
```
|