Repository navigation
fix(models): correct phi4 package metadata and drop dead GGUF eval hiding - #6377
Merged
Merged
Conversation
added 2 commits
November 29, 2026 12:03
The phi4mm definition was ported off Microsoft's remote code in #4620. The removed `speech_conformer_encoder` was the only `backoff` user, and nothing on the package-owned native path imports `optimum`; `backoff` is not installed in the CPU test environment, so restoring either requirement would reject a valid install. Keep `require_pkgs` empty and make the test assert that, with the reasoning documented next to the declaration. The port's optional torchvision/scipy imports already fail with LocalModelLoader's `gptqmodel[vision]`/`gptqmodel[audio]` install hint, so they do not need a load-time version check.
`_hide_unsupported_quantization_config_for_eval` and its lm-eval wrapper had no callers. The only reason to keep them was the assumption that Transformers cannot evaluate a GGUF quantization config, but Transformers 5.23 constructs `GgufConfig` from it and `AutoModelForCausalLM.from_pretrained` now loads and forwards such a checkpoint through `GgufHfQuantizer`. The hiding branch was therefore unreachable even if called. Remove both helpers, their now-unused `contextmanager` import, and the two tests that only exercised the deleted context managers.
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
Two independent pre-existing bugs found by the
origin/main=0dd8e8absweep.Fixes #6365, #6366
#6365 —
test_phi4_model_definition_requires_required_packagesThe test was stale, not the definition. #4620 replaced Microsoft's remote-code phi4mm path with the package-owned native port. The removed
speech_conformer_encoderwas the onlybackoffimporter, and nothing on the native path importsoptimum;backoffis not installed in the CPU test environment, so restoring either requirement would reject a valid install.Phi4MMGPTQ.require_pkgsstays empty, now with a comment documenting why. The port's optionaltorchvision/scipyimports are already reported byLocalModelLoaderwith thegptqmodel[vision]/gptqmodel[audio]install hint (verified by blocking the import), so no load-time version check is needed.tests/test_model.py::test_phi4_model_definition_requires_required_packages('backoff>=2.2.1' in [])#6366 —
test_hide_unsupported_quantization_config_for_eval_temporarily_clears_gguf_bits_hide_unsupported_quantization_config_for_evaland_hide_unsupported_quantization_config_for_lm_evalhad no callers. The only reason to keep them was the assumption that Transformers cannot evaluate a GGUF quantization config, but Transformers 5.23 now constructsGgufConfigfrom it andAutoModelForCausalLM.from_pretrainedloads and forwards such a checkpoint throughGgufHfQuantizer(verified with a tiny Llama checkpoint: load + forward pass). The hiding branch was unreachable even if called, so the helpers, the unusedcontextmanagerimport, and the two tests that only exercised them are removed.tests/test_model.py::test_hide_unsupported_quantization_config_for_eval_temporarily_clears_gguf_bitson base; the node is intentionally deleted with the dead code, so it no longer exists on the branch.Verification
tests/test_model.py— 25 passed, 2 skipped.tests/test_require_pkgs.py— 13 passed.tests/test_phi4_local_port.py— 83 passed.tests/module_tree/test_phi4_local_port.py— 13 passed.require_pkgsreferences (test_smolvlm_support.py,test_ported_fp32_load_6136.py,test_qwen2_5_omni_lm_head.py,test_qwen3_omni_key_map_4881.py,test_gguf_load_policy_env_removal.py,test_lazy_turtle_conversion_cache.py,test_loader_tokenizer_flag_4941.py,test_local_model_paths.py,module_tree/test_nemotron_h_puzzle_local_port.py) — passed.tests/models/test_cohere_compass.pyhas 2 failures (auto.AutoConfigattribute, native ropeKeyError: 'full_attention'); both reproduce on unmodifiedorigin/mainand are unrelated./root/venv/bin/ruff check gptqmodel/models/auto.py gptqmodel/models/definitions/phi4.py tests/test_model.py— all checks passed.