Downloads · 30 days
0
reasonwang/flan-gpteacher-lora-xl
flan-gpteacher-lora-xl is a machine learning model from reasonwang. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Out repository flan-alpaca-lora contains the details to train flan-t5 with Alpaca instructions and low-rank adaptation.
Downloads · 30 days
0
Access
Public
Updated Apr 13, 2023
Repo size
19 MB
Likes
0
Public
Click a slice to open those files.
.bin19 MB · 100%
From the Hugging Face model README
Out repository flan-alpaca-lora contains the details to train flan-t5 with Alpaca instructions and low-rank adaptation.
This model is trained with GPTeacher instructions (Instruct and Roleplay).
Usage:
import transformers
from peft import PeftModel
model_name = "google/flan-t5-xl"; peft_model_id = "reasonwang/flan-gpteacher-lora-xl"
tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)
base_model = transformers.AutoModelForSeq2SeqLM.from_pretrained(model_name)
peft_model = PeftModel.from_pretrained(base_model, peft_model_id)
inputs = tokenizer("If you are the president of a developing country, what you will do to make your country better?", return_tensors="pt")
outputs = peft_model.generate(**inputs, max_length=256, do_sample=True)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))
# I will take immediate steps to improve education and infrastructure so that citizens thrive.
# I will also invest in infrastructure upgrades such as hospitals and electricity distribution lines, as well as encouraging innovation in our resiliency infrastructure.
# I will also focus on promoting trade and investment between countries, both for economic and cultural benefit.