reasonwang commited on
Commit
97e16e5
1 Parent(s): e40627f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -2
README.md CHANGED
@@ -12,8 +12,10 @@ Usage:
12
  import transformers
13
  from peft import PeftModel
14
 
15
- base_model = transformers.AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-large")
16
- peft_model = PeftModel.from_pretrained(base_model,"reasonwang/flan-alpaca-lora-large")
 
 
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)