Downloads · 30 days
9
35% of all-time downloads
Nikichoksi/llama2-7b-instruction-tuned
llama2-7b-instruction-tuned is a text generation model from Nikichoksi. Use it when you need the model to write or continue text. It is set up for peft.
This model is the result of Step 4 of INFO 7374 Assignment 3, implementing the "Self-Alignment with Instruction Backtranslation" paper (https://arxiv.org/pdf/2308.06259.pdf) using LoRA-based finetuning. It was trained…
Downloads · 30 days
9
35% of all-time downloads
All-time downloads
26
Public
Repo size
505 KB
Likes
0
Public
Click a slice to open those files.
.json3.6 MB · 88%
From the Hugging Face model README
This model is the result of Step 4 of INFO 7374 Assignment 3, implementing the "Self-Alignment with Instruction Backtranslation" paper (https://arxiv.org/pdf/2308.06259.pdf) using LoRA-based finetuning. It was trained on OpenAssistant-Guanaco seed data, followed by synthetic instruction generation from LIMA completions and LLM-based filtering.
This model can be used for zero-shot or few-shot instruction following tasks. It predicts instructions given outputs during backward model training, and later produces aligned responses for synthetic instruction/response pairs.
The model can serve as a base for further instruction tuning or evaluation research.
from transformers import AutoModelForCausalLM, AutoTokenizer
model = AutoModelForCausalLM.from_pretrained("Nikichoksi/llama2-7b-instruction-tuned")
tokenizer = AutoTokenizer.from_pretrained("Nikichoksi/llama2-7b-instruction-tuned")
prompt = "Write a haiku about the moon."
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100)
print(tokenizer.decode(outputs[0]))