Repository navigation
Troubleshooting
Use these checks to isolate dataset, tokenizer, checkpoint and launcher failures without changing unrelated components.
The data iterator produced no usable samples. Check dataset configuration (en for the illustrated medical dataset), --hf-split train, --schema question_response, filtering, and special-token coverage. Setting --num-workers 0 eliminates worker sharding as one possible cause but does not correct schema or tokenizer errors.
python -m scripts.finetune_medical --help
python -c "from tokenizers import Tokenizer; t=Tokenizer.from_file('artifacts/healthcare_tokenizer.json'); print({x:t.token_to_id(x) for x in ['<pad>','<unk>','<bos>','<eos>']})"The BPE model references an unknown-token marker that is not actually registered. The current tokenizer trainer includes <unk> as a special token; do not silently mutate a tokenizer used by a pretrained checkpoint, as vocabulary IDs and model embeddings must remain aligned. Audit problematic samples, test tokenizer coverage and preserve checkpoint compatibility.
Confirm special-token IDs and compare tokenizer.get_vocab_size() with ModelConfig.vocab_size. Stage 1 and Stage 2 must use matching tokenizer IDs and architecture.
This is intentional: use --pretrained for the first SFT run, or --resume to continue an SFT checkpoint. Never use both in the same command.
For a single-process run, inspect the actual last.pt file in the selected output directory. Do not assume step_XXXXXXXX is a file; that pattern refers to the separate distributed-checkpoint format.
Get-ChildItem .\checkpoints -Recurse -File | Select-Object -ExpandProperty FullNameThe repository's single-process strategy starts with python -m scripts... and avoids distributed rendezvous. Other strategies require a properly configured PyTorch distributed backend. Resolve backend compatibility separately from dataset/model failures.
Check the validation sample count, fixed seed, data overlap, truncation and answer-only masking. A few token-level measurements should not be interpreted as clinical quality.
Foundations
Data and Training
Operation and Quality
- Checkpoints and Resume
- Evaluation and Validation
- Testing and Reproducibility
- Troubleshooting
- Long Context and Limitations
Architecture diagrams