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