unsloth/unsloth
Daniel Han 52e35bbfd7 Fix VLM model + text-only dataset ValueError in TRL 0.22.x (#4004)
TRL 0.22.x checks _is_vlm (model type) instead of _is_vision_dataset
(dataset content, added in 0.25.1+) in _set_signature_columns_if_needed.
When _is_vlm=True (e.g. Gemma3), signature columns are set to vision-only
["messages","prompt","completion","images"], which has zero overlap with
tokenized text columns [input_ids, labels, attention_mask, ...], causing
a ValueError.

Fix: expand the VLM branch signature columns to include both vision and
text column names. Extra columns not present in the dataset are harmlessly
ignored by _remove_unused_columns (it only raises when zero columns match).

Co-authored-by: Daniel Hanchen <danielhanchen@users.noreply.github.com>
2026-02-09 06:24:58 -08:00
..
dataprep [pre-commit.ci] auto fixes from pre-commit.com hooks 2026-01-08 11:35:21 +00:00
kernels [MoE] Improve moe kernels for unsloth fine tuning (#3812) 2026-02-05 06:03:25 -08:00
models Fix VLM model + text-only dataset ValueError in TRL 0.22.x (#4004) 2026-02-09 06:24:58 -08:00
registry Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" 2025-12-01 07:24:58 -08:00
utils Refactor Ollama template wiring and harden packing helpers (#3890) 2026-02-09 04:04:48 -08:00
__init__.py Fix triton 3.6.0 + torch 2.9.x torch.compile crash (missing cluster_dims) (#4001) 2026-02-08 20:18:25 -08:00
_auto_install.py Add PyTorch 2.10 and xformers 0.0.34 support (#3985) 2026-02-05 05:56:26 -08:00
chat_templates.py Refactor Ollama template wiring and harden packing helpers (#3890) 2026-02-09 04:04:48 -08:00
device_type.py Add missing import of inspect (#3778) 2025-12-25 18:43:59 -08:00
import_fixes.py Fix notebook compatibility for transformers 4.57.6 and TRL 0.22-0.27 (#3998) 2026-02-09 05:11:50 -08:00
ollama_template_mappers.py Refactor Ollama template wiring and harden packing helpers (#3890) 2026-02-09 04:04:48 -08:00
save.py [Feature] seperate gguf file path (#3934) 2026-02-09 04:00:14 -08:00
tokenizer_utils.py Fix notebook compatibility for transformers 4.57.6 and TRL 0.22-0.27 (#3998) 2026-02-09 05:11:50 -08:00
trainer.py Fix notebook compatibility for transformers 4.57.6 and TRL 0.22-0.27 (#3998) 2026-02-09 05:11:50 -08:00