What it does
Before: "Hello! I'm Qwen, an AI assistant created by Alibaba Cloud..."
After: "Cap'n Byte here. Ask away, mate, I'll do my best to answer yer questions."
How I built it
- Base model: Qwen2.5-7B-Instruct
- Method: QLoRA (4-bit quantization + LoRA adapters, using
transformers, peft, trl)
- Dataset: 29 examples I wrote myself, covering questions, coding help, advice, and casual chat
- Trained on my own GPU (RTX 4070 Super, 12GB VRAM) in under a minute
What I learned
Teaching the model a style (talking like a pirate) worked well from just ~25 examples. Teaching it a specific fact (who made it) did not work as well from only ~5 examples — it needed way more repetition, or putting the fact directly in the system prompt instead.
Use it
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfigfrom peft import PeftModelimport torch bnb_config = BitsAndBytesConfig(load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype=torch.bfloat16)base = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct", quantization_config=bnb_config, device_map="auto")model = PeftModel.from_pretrained(base, "SkullSameh/captain-byte-qwen2.5-7b")tokenizer = AutoTokenizer.from_pretrained("SkullSameh/captain-byte-qwen2.5-7b")
Just a learning project, not production-ready — but a real, complete fine-tune I built and debugged myself.