Downloads · 30 days
0
AnasTabba/tinyllama-alpaca-sft
tinyllama-alpaca-sft is a text generation model from AnasTabba. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as apache-2.0.
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,…
Downloads · 30 days
0
Access
Public
Updated Jun 5, 2026
Parameters
1.1B
2.2 GB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors2.2 GB · 100%
From the Hugging Face model README
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).
| 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.
| 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 |
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))