Downloads · 30 days
11
15% of all-time downloads
SkullSameh/captain-byte-qwen2.5-7b
captain-byte-qwen2.5-7b is a machine learning model from SkullSameh. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft. The card lists the license as apache-2.0.
I fine-tuned Qwen2.5-7B-Instruct to talk like an old sea captain, as a weekend project to learn how fine-tuning actually works.
Downloads · 30 days
11
15% of all-time downloads
All-time downloads
75
Public
Repo size
173 MB
Likes
1
Public
Click a slice to open those files.
.safetensors162 MB · 93%
From the Hugging Face model README
I fine-tuned Qwen2.5-7B-Instruct to talk like an old sea captain, as a weekend project to learn how fine-tuning actually works.
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."
transformers, peft, trl)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.
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
from peft import PeftModel
import 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.