reasonwang
commited on
Commit
•
97e16e5
1
Parent(s):
e40627f
Update README.md
Browse files
README.md
CHANGED
@@ -12,8 +12,10 @@ Usage:
|
|
12 |
import transformers
|
13 |
from peft import PeftModel
|
14 |
|
15 |
-
|
16 |
-
|
|
|
|
|
17 |
|
18 |
inputs = tokenizer("List a few tips to get good scores in math.", return_tensors="pt")
|
19 |
outputs = peft_model.generate(**inputs, max_length=128, do_sample=True)
|
|
|
12 |
import transformers
|
13 |
from peft import PeftModel
|
14 |
|
15 |
+
model_name = "google/flan-t5-large"; peft_model_id = "reasonwang/flan-alpaca-lora-large"
|
16 |
+
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
|
17 |
+
base_model = transformers.AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
18 |
+
peft_model = PeftModel.from_pretrained(base_model, peft_model_id)
|
19 |
|
20 |
inputs = tokenizer("List a few tips to get good scores in math.", return_tensors="pt")
|
21 |
outputs = peft_model.generate(**inputs, max_length=128, do_sample=True)
|