Downloads · 30 days
0
harshithaarlapalli/harshitha-tiny-gpt2-lora
harshitha-tiny-gpt2-lora is a machine learning model from harshithaarlapalli. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository contains LoRA adapter weights fine-tuned on a small instruction dataset using sshleifer/tiny-gpt2. These adapter weights can be applied on top of the base model to reproduce fine-tuned behavior.
Downloads · 30 days
0
Access
Public
Updated Dec 9, 2025
Repo size
2.7 MB
Likes
0
Public
Click a slice to open those files.
.json4.4 MB · 58%
From the Hugging Face model README
This repository contains LoRA adapter weights fine-tuned on a small instruction dataset using sshleifer/tiny-gpt2.
These adapter weights can be applied on top of the base model to reproduce fine-tuned behavior.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
base_model = "sshleifer/tiny-gpt2"
adapter_repo = "<your-username>/<your-repo>" # replace with your repo name
# Load tokenizer and base model
tok = AutoTokenizer.from_pretrained(base_model)
model = AutoModelForCausalLM.from_pretrained(base_model)
# Load LoRA adapter
model = PeftModel.from_pretrained(model, adapter_repo)
# Test generation
prompt = "Explain AI in simple terms."
inputs = tok(prompt, return_tensors="pt")
out = model.generate(**inputs, max_new_tokens=50)
print(tok.decode(out[0], skip_special_tokens=True))