YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

LoRA Fine-Tuned Adapter for Tiny GPT-2

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.


πŸ“Œ How to Use This Adapter

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))
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support