Repository navigation
Conversation
…4228) Vision-language `prepare_dataset` overrides sent every calibration row to `processor.apply_chat_template`, so the token-id rows the public `quantize()` API accepts crashed with `AttributeError: 'int' object has no attribute 'get'` or `KeyError: 'content'`. Fully pre-tokenized datasets now go to `BaseQModel.prepare_dataset`, a dataset that mixes token ids with conversations is rejected with a clear error, and `calibration_concat_size` on the conversation path is rejected instead of silently ignored. `calibration_sort` and `calibration_data_min_length` are applied to the processor-prepared batches.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Most VLM
prepare_datasetoverrides sent token-id rows toprocessor.apply_chat_template, crashing on inputs the public API accepts ([ids, ids],[{"input_ids", "attention_mask"}]). They also ignoredcalibration_concat_size,calibration_sortandcalibration_data_min_length.What Changed
gptqmodel/models/definitions/_vlm_calibration.pyhelper: fully pre-tokenized datasets fall back toBaseQModel.prepare_dataset(so all base options work); mixed token-id/conversation datasets raise a clearValueError; conversation path rejectscalibration_concat_sizeexplicitly and appliescalibration_sort/calibration_data_min_length.base_qwen2_vl(Qwen2/2.5-VL),base_qwen2_5_omni,internvl,internvl_chat,ovis2,lfm2_vl,smolvlm,llava,minicpmv,minicpmv_4_6,minicpm_o, plus option handling ingemma3andbase_qwen3_vl.tests/test_vlm_pretokenized_calibration.py(91 parametrized cases over 17 classes).Tests
Note: ~20 further VLM definitions have their own overrides and can adopt the same helper in a follow-up; the issue's named set is covered.
Fixes #4228
Model Support / Module Plan
N/A — no new model types or registry entries.
Verification environment
No compiled GPTQModel extensions are built in this environment (Machete/Marlin/QQQ-CUDA unavailable), so hardware-specific paths are called out explicitly above. The 19 fix branches from this sprint merge cleanly into one integration branch; the combined run was 195 passed, 2 skipped,
ruff checkclean.