Downloads · 30 days
27
21% of all-time downloads
AshishKJain/gpt2-large-alpaca-sft
gpt2-large-alpaca-sft is a text generation model from AshishKJain. Use it when you need the model to write or continue text. The card lists the license as mit.
This is a GPT2-Large (774M parameters) model fine-tuned on the Stanford Alpaca instruction dataset. The model has been trained to follow instructions and generate appropriate responses in an instruction-following format.
Downloads · 30 days
27
21% of all-time downloads
All-time downloads
131
Public
Parameters
838M
3.4 GB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors3.4 GB · 100%
From the Hugging Face model README
This is a GPT2-Large (774M parameters) model fine-tuned on the Stanford Alpaca instruction dataset. The model has been trained to follow instructions and generate appropriate responses in an instruction-following format.
from transformers import GPT2LMHeadModel, GPT2Tokenizer
# Load model and tokenizer
model = GPT2LMHeadModel.from_pretrained("AshishKJain/gpt2-large-alpaca-sft")
tokenizer = GPT2Tokenizer.from_pretrained("AshishKJain/gpt2-large-alpaca-sft")
# Prepare prompt in Alpaca format
prompt = """Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
Give three tips for staying healthy.
### Response:
"""
# Generate response
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(
inputs['input_ids'],
max_new_tokens=256,
temperature=0.7,
top_k=50,
do_sample=True,
pad_token_id=tokenizer.eos_token_id,
)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(response)
The model expects prompts in the following format:
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
[Your instruction here]
### Response:
For tasks with additional input context:
Below is an instruction that describes a task. Write a response that appropriately completes the request.
### Instruction:
[Your instruction here]
### Input:
[Additional context]
### Response:
This model is released under the MIT License. However, note that:
If you use this model, please cite:
@misc{gpt2-large-alpaca,
author = {Ashish K Jain},
title = {GPT2-Large Fine-tuned on Alpaca Instructions},
year = {2025},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/AshishKJain/gpt2-large-alpaca-sft}}
}