Downloads · 30 days
3
2% of all-time downloads
mouhamadNIbrahim/qwen15-fitness-qlora-adapter
qwen15-fitness-qlora-adapter is a text generation model from mouhamadNIbrahim. 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.
Owner: @mouhamadNIbrahim Base model: Qwen/Qwen1.5-1.8B-Chat Format: PEFT LoRA adapter (trained via QLoRA / 4‑bit NF4) Use case: concise personal helper & evidence‑minded fitness coach
Downloads · 30 days
3
2% of all-time downloads
All-time downloads
196
Public
Repo size
71.4 MB
Likes
0
Public
Click a slice to open those files.
.safetensors60 MB · 79%
From the Hugging Face model README
Owner: @mouhamadNIbrahim
Base model: Qwen/Qwen1.5-1.8B-Chat
Format: PEFT LoRA adapter (trained via QLoRA / 4‑bit NF4)
Use case: concise personal helper & evidence‑minded fitness coach
⚠️ Note: This repo contains only the adapter weights. Load it on top of the base model. For serving engines that don’t support PEFT (e.g., vLLM), first merge the adapter (see below).
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
BASE = "Qwen/Qwen1.5-1.8B-Chat"
ADAPTER = "mouhamadNIbrahim/qwen15-fitness-qlora-adapter"
tok = AutoTokenizer.from_pretrained(BASE)
model = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.bfloat16, device_map="auto")
model = PeftModel.from_pretrained(model, ADAPTER).to(model.device)
messages = [
{"role":"system","content":"You are a concise, friendly personal helper and fitness coach. Be evidence-based, practical, and safe."},
{"role":"user","content":"Give me a 4-day full-body plan and macros for a 69 kg male."}
]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
outputs = model.generate(**tok([text], return_tensors="pt").to(model.device), max_new_tokens=300)
print(tok.decode(outputs[0], skip_special_tokens=True))
q_proj, k_proj, v_proj, o_proj, up_proj, gate_proj, down_proj.adapter_model.safetensors — LoRA weights (LFS)adapter_config.json — PEFT/LoRA configchat_template.jinja — ChatML template referenceSome runtimes (e.g., vLLM, TGI) need merged weights.
from transformers import AutoTokenizer, AutoModelForCausalLM
from peft import PeftModel
import torch
BASE = "Qwen/Qwen1.5-1.8B-Chat"
ADPT = "mouhamadNIbrahim/qwen15-fitness-qlora-adapter"
tok = AutoTokenizer.from_pretrained(BASE)
base = AutoModelForCausalLM.from_pretrained(BASE, torch_dtype=torch.bfloat16, device_map="auto")
merged = PeftModel.from_pretrained(base, ADPT).merge_and_unload()
merged.save_pretrained("./qwen15-fitness-merged", safe_serialization=True)
tok.save_pretrained("./qwen15-fitness-merged")
Qwen/Qwen1.5-1.8B-Chatapply_chat_templater=16, alpha=32, dropout=0.05, bias=noneq_proj,k_proj,v_proj,o_proj,up_proj,gate_proj,down_projpaged_adamw_8bitbf16 if available (fallback fp16)per_device_train_batch_size=2, gradient_accumulation_steps=8Reproducibility: see
training_args.binandtrainer_state.jsonin your training runs. Dataset not released; marked asprivate.
No formal benchmarks included. Manually validated on:
If you run quantitative evals (e.g., custom fitness QA set), please share results via PR/issues.
The finetune includes examples that: request context (age, weight, goals), caution on injuries, recommend professional help when necessary. Still, errors or bias can occur.
Uses
transformers,peft,trl,bitsandbytes.
# Key ingredients used in training
from transformers import BitsAndBytesConfig
from peft import LoraConfig
from trl import SFTTrainer, DataCollatorForCompletionOnlyLM
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_use_double_quant=True,
)
lora = LoraConfig(
r=16, lora_alpha=32, lora_dropout=0.05, bias="none",
task_type="CAUSAL_LM",
target_modules=["q_proj","k_proj","v_proj","o_proj","up_proj","gate_proj","down_proj"],
)
# Data formatted with tokenizer.apply_chat_template([...])
# and collated with DataCollatorForCompletionOnlyLM(
# response_template="<|im_start|>assistant\n", tokenizer=tokenizer
# )
@software{qwen15_fitness_qlora_adapter,
author = {Ibrahim, Mouhamad},
title = {Qwen1.5-1.8B-Chat — Fitness & Personal Helper (QLoRA Adapter)},
year = {2025},
url = {https://huggingface.co/mouhamadNIbrahim/qwen15-fitness-qlora-adapter}
}