reasonwang commited on
Commit
38909ec
1 Parent(s): dc3db86

Update README.md

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