Qwen1.5โ€‘1.8Bโ€‘Chat โ€” Fitness & Personal Helper (QLoRA Adapter)

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).


๐Ÿ”ฐ TL;DR โ€” Quickstart

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))

๐Ÿง  Whatโ€™s inside

  • Finetuned on curated fitness Q&A + helper behaviors (chat format) to give short, actionable responses.
  • Keeps Qwenโ€™s ChatML style; training masks only assistant tokens (completionโ€‘only loss).
  • LoRA target modules: q_proj, k_proj, v_proj, o_proj, up_proj, gate_proj, down_proj.
  • Quantization: bitsandbytes 4โ€‘bit NF4 with double quant (QLoRA recipe).

๐Ÿ“ฆ Files

  • adapter_model.safetensors โ€” LoRA weights (LFS)
  • adapter_config.json โ€” PEFT/LoRA config
  • (optional) tokenizer files โ€” not required for adapters; base model tokenizer is recommended
  • chat_template.jinja โ€” ChatML template reference

๐Ÿ› ๏ธ Merge to a single model (optional)

Some 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")

๐Ÿ“š Training details

  • Base: Qwen/Qwen1.5-1.8B-Chat
  • Method: QLoRA (PEFT/LoRA on 4โ€‘bit base)
  • Tokenizer: base model tokenizer + apply_chat_template
  • Loss: completionโ€‘only (mask nonโ€‘assistant tokens)
  • LoRA: r=16, alpha=32, dropout=0.05, bias=none
  • Targets: q_proj,k_proj,v_proj,o_proj,up_proj,gate_proj,down_proj
  • Optimizer: paged_adamw_8bit
  • Scheduler: cosine; warmup 3%
  • Precision: bf16 if available (fallback fp16)
  • Seq length: up to 2048 tokens
  • Batching: per_device_train_batch_size=2, gradient_accumulation_steps=8
  • Other: gradient checkpointing enabled
  • Hardware: single GPU (tested on RTX 4090 / A4000 / 3090 class)

Reproducibility: see training_args.bin and trainer_state.json in your training runs. Dataset not released; marked as private.


๐Ÿงช Evaluation (placeholder)

No formal benchmarks included. Manually validated on:

  • Workout planning prompts (4โ€‘day/5โ€‘day splits, fullโ€‘body, push/pull/legs)
  • Macro guidance and calorie targets (Mifflinโ€‘St Jeor, TDEE assumptions)
  • Lifestyle coaching quick answers

If you run quantitative evals (e.g., custom fitness QA set), please share results via PR/issues.


โš–๏ธ Intended use & limitations

  • Intended use: consumer fitness guidance, scheduling/helpful assistant tasks, basic nutrition coaching.
  • Not for: medical diagnosis, treatment, or individualized clinical nutrition. The model can be confident yet wrong.
  • Use responsibly: always verify critical advice; consult a professional for injuries/health conditions.

๐Ÿ”’ Safety

The finetune includes examples that: request context (age, weight, goals), caution on injuries, recommend professional help when necessary. Still, errors or bias can occur.


๐Ÿ“ Example prompts

  • โ€œDesign a 4โ€‘day fullโ€‘body plan for a beginner with access to dumbbells only.โ€
  • โ€œIโ€™m 69 kg, 173 cm, ~8k steps/day. Estimate maintenance calories and macros for lean bulk.โ€
  • โ€œGive me 3 highโ€‘protein Lebanese meal ideas under 700 kcal each.โ€

๐Ÿ” Training recipe (script sketch)

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
# )

๐Ÿ“ฅ How to cite

@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}
}

๐Ÿ™ Acknowledgements

  • QLoRA: Dettmers et al. (2023)
  • PEFT: Mangrulkar et al. (2022)
  • Qwen team for the base model and ChatML template

๐Ÿ“„ License

  • Adapter released under Apacheโ€‘2.0. The base modelโ€™s original license also applies when combining weights.
Downloads last month
30
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for mouhamadNIbrahim/qwen15-fitness-qlora-adapter

Adapter
(331)
this model