Fine-tuning Pipeline Build and Debug | Generated by AI

Home 2026.06

What We Did — Full Summary

1. Built the Fine-tuning Pipeline (/mnt/data/zz/finetune/)

Dataset extraction (build_dataset.py):

Training script (train.py):

Supporting scripts:

2. Model Download Dance

Tried 4 models before finding what works:

Model Size Result
unsloth/Qwen3-8B (4-bit) 7.5GB Download too slow (300KB/s), killed
Qwen/Qwen3.5-9B (cached) 18GB VL model, wrong type
Qwen/Qwen3-4B-FP8 (cached) 4.9GB Hung during Unsloth load
unsloth/Qwen3-4B-unsloth-bnb-4bit 3.4GB Downloaded via curl, works

Downloaded from huggingface.co at ~37MB/s (speed recovered from earlier 300KB/s). Set up HF cache structure manually with symlinks since hf CLI / hf-mirror.com didn’t have the model.

3. Unsloth → Pure Transformers Pivot

Unsloth’s Triton kernels segfault consistently on this setup:

Fix: Dropped Unsloth entirely, used:

4. TRL 0.24 API Fixes

The installed TRL 0.24.0 changed APIs from the docs:

5. Git Commits

8292db9  add finetune pipeline for lzwjava notes SFT
9aaa8f3  fix train.py: use pure transformers+peft, fix TRL 0.24 API

Pushed to github.com:lzwjava/zz.git. JSONL files gitignored.

6. Ready to Run

cd /mnt/data/zz/finetune && python3.11 train.py

Back Donate