Downloads · 30 days
0
zirui3/flan-t5-large-alpaca
flan-t5-large-alpaca is a machine learning model from zirui3. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Train flan-T5-large on alpaca dataset with LoRA
Downloads · 30 days
0
Access
Public
Updated Mar 30, 2023
Repo size
9.5 MB
Likes
1
Public
Click a slice to open those files.
.bin9.5 MB · 100%
From the Hugging Face model README
Train flan-T5-large on alpaca dataset with LoRA
import transformers
from peft import PeftModel
base_model = transformers.AutoModelForSeq2SeqLM.from_pretrained("google/flan-t5-large")
peft_model = PeftModel.from_pretrained("zirui3/flan-t5-large-alpaca")
inputs = tokenizer("Any instruction that you like.", return_tensors="pt")
outputs = peft_model.generate(**inputs, max_length=128, do_sample=True)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True)