Base Model
- TinyLlama/TinyLlama-1.1B-Chat-v1.0
Training Details
- Framework: Hugging Face Transformers
- PEFT Method: LoRA
- Trainer: TRL SFTTrainer
- Dataset: tatsu-lab/alpaca
- Epochs: 1
- LoRA Rank (r): 8
- LoRA Alpha: 16
- LoRA Dropout: 0.05
- Target Modules:
Usage
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
tokenizer = AutoTokenizer.from_pretrained(
"TinyLlama/TinyLlama-1.1B-Chat-v1.0"
)
base_model = AutoModelForCausalLM.from_pretrained(
"TinyLlama/TinyLlama-1.1B-Chat-v1.0"
)
model = PeftModel.from_pretrained(
base_model,
"Rupa421/TinyLlama-LoRA"
)
Example Prompt
### Instruction:
Explain what LoRA is.
### Response:
Project Goal
This project was built to demonstrate an end-to-end parameter-efficient fine-tuning (PEFT) workflow using:
- Hugging Face Transformers
- PEFT (LoRA)
- TRL SFTTrainer
- TinyLlama
The project covers dataset formatting, prompt engineering, LoRA configuration, supervised fine-tuning, inference, and publishing the trained adapter to Hugging Face.
Author
Built with ❤️ while learning PyTorch Internals and Transformer Architecture.