tatsu-lab/alpaca
Viewer • Updated • 52k • 101k • 959
This is a 124M parameter Language Model (GPT-2 Small architecture) fine-tuned on the Alpaca dataset for instruction following.
It is part of the "Small Language Model (SLM)" project, trained from scratch on educational data (FineWeb-Edu) and then fine-tuned on instructions.
This model requires a specific prompt format to function correctly.
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{your_instruction}
### Response:
from transformers import GPT2LMHeadModel, GPT2Tokenizer
model = GPT2LMHeadModel.from_pretrained("koganrath/LiteGPT-Instruct")
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
instruction = "List three primary colors."
prompt = f"""Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
{instruction}
### Response:
"""
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=50)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Trained by koganrath as part of the LiteGPT Project.