Sylvia2025
commited on
Commit
•
1a2ae50
1
Parent(s):
bcdd6d4
Update README.md
Browse files
README.md
CHANGED
@@ -48,22 +48,6 @@ The following hyperparameters were used during training:
|
|
48 |
|
49 |
### Training results
|
50 |
|
51 |
-
### Use with transformers
|
52 |
-
from peft import PeftModel, PeftConfig
|
53 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
54 |
-
|
55 |
-
#Load the base model and tokenizer
|
56 |
-
model = AutoModelForCausalLM.from_pretrained('meta-llama/Meta-Llama-3-8B')
|
57 |
-
tokenizer = AutoTokenizer.from_Pretrained('meta-llama/Meta-Llama-3-8B')
|
58 |
-
model = PeftModel.from_pretrained(model=model, model_id='Sylvia2025/llama3-8B-alpaca_zh ')
|
59 |
-
|
60 |
-
query= '你是谁?'
|
61 |
-
|
62 |
-
#Generate an answer from the model
|
63 |
-
inputs = tokenizer.encode(query, return_tensor='pt')
|
64 |
-
ouputs = model.generate(inputs)
|
65 |
-
response = tokenizer.decode(ouputs[0], skip_special_tokens=True)
|
66 |
-
print(response)
|
67 |
|
68 |
|
69 |
|
|
|
48 |
|
49 |
### Training results
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
|
52 |
|
53 |
|