Instructions to use AnasTabba/tinyllama-alpaca-sft with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use AnasTabba/tinyllama-alpaca-sft with PEFT:
Task type is invalid.
- Notebooks
- Google Colab
- Kaggle
TinyLlama-1.1B Instruction-Tuned (Alpaca SFT)
Supervised fine-tune of TinyLlama/TinyLlama-1.1B-Chat-v1.0 on the Stanford Alpaca instruction dataset using LoRA (4-bit QLoRA training). The LoRA adapter has been merged into the base weights, so this repo is a full, ready-to-run model โ no PEFT needed.
NLP Assignment 4 โ Track 1 (LLM Fine-Tuning), Option B (Multi-Dataset SFT). This is the best-performing configuration (Alpaca, trial 4) selected from 10 trials across two datasets (Alpaca and Dolly-15k).
Results (10 manual test prompts, vs. ChatGPT-4o gold answers)
| Model | BLEU | BERTScore F1 |
|---|---|---|
| Baseline TinyLlama | 3.7116 | 0.8732 |
| This model (Alpaca SFT) | 4.7111 | 0.8710 |
The Alpaca fine-tune improved BLEU by ~27% over the baseline.
Training configuration
| Hyperparameter | Value |
|---|---|
| Method | QLoRA (4-bit NF4) |
| LoRA rank (r) | 32 |
| LoRA alpha | 64 |
| Target modules | q_proj, v_proj |
| LoRA dropout | 0.05 |
| Learning rate | 3e-4 |
| Epochs | 2 |
| Dataset | tatsu-lab/alpaca (2,000 samples) |
| Hardware | Kaggle Tesla T4 |
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_id = "AnasTabba/tinyllama-alpaca-sft"
tok = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
prompt = "<|user|>\nExplain what machine learning is in simple terms.</s>\n<|assistant|>\n"
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=200, temperature=0.7, do_sample=True)
print(tok.decode(out[0], skip_special_tokens=True))
- Downloads last month
- -
Model tree for AnasTabba/tinyllama-alpaca-sft
Base model
TinyLlama/TinyLlama-1.1B-Chat-v1.0