Debug Modal fine-tuning script for MiniCPM5-1B and migrate HF repo paths
Session from kirana-detective-build-traces on Hugging Face by build-small-hackathon · MIT · condensed by Coders Talk
51msession
1interventions
GOAL
Fix a failing Modal training job for fine-tuning MiniCPM5-1B on Indian FMCG product names, then generate model cards and migrate all HuggingFace repo references to a new hackathon org.
- +0Prompt · +0Fix this Modal training script error: SFTTrainer needs a formatting_func for chat/messages format dataset
- +0mAgent did · +0mAdded a formatting_func applying the tokenizer's chat template to convert messages into training text
- +3mFail · +3mSame traceback again — Unsloth passes batches not single examples to formatting_func
- +3mAgent did · +3mRewrote formatting_func to accept a batch dict and return a list of strings
- +5mIntervention · +5mStill crashing on the probe call; told the agent to 'research and fix properly' instead of patching againWhy: The quick patches kept breaking on the same root cause, so I wanted a proper fix, not another band-aid.
- +5mAgent did · +5mSwitched approach: pre-mapped dataset to a 'text' column and used dataset_text_field instead of formatting_func, per Unsloth's recommended pattern
- +13mFail · +13mTraining succeeded but GGUF conversion failed — llama.cpp installer calls input() in non-interactive container
- +13mAgent did · +13mPre-installed curl, git, cmake, libssl-dev, libcurl4-openssl-dev in the Modal image so Unsloth skips the interactive prompt
- +29mFail · +29mJob completed but HF repo only had gitignore/readme — no model files uploaded
- +29mAgent did · +29mFound Unsloth appends '_gguf' to the output path so upload scanned the wrong dir; fixed path, then generated model cards for MiniCPM5-1B and YOLO26n, and migrated all naazimsnh02/ HF repo references across ~15 files to build-small-hackathon/ org
- +51mOutcome · +51mTraining pipeline fixed end-to-end (3 root causes resolved), model published to HF with correct files, two model cards generated, and all repo references migrated across the codebase with zero stragglers on final grep
VERDICT
Next time I'd paste the full Unsloth/Modal error and ask for the actual root cause up front instead of letting quick patches loop on the same symptom. Telling it to 'research and fix properly' after the second identical crash is what got us off the formatting_func rabbit hole and onto the dataset_text_field fix that actually worked. The rest — GGUF path bug, org migration — went smoothly once the trainer itself was solid.