You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] Regression from #4373 fix: explicit trust_remote_code=True now loads remote code for natively supported Phi-3.5-MoE / Phi-tiny-MoE / MPT / MiniMax-M2, because the class-name comparison is case/naming sensitive #4453
Severity: medium. Kind: regression from d01e8fd (#4373). Confirmed at 489aed6.
gptqmodel/utils/hf.py_checkpoint_remote_layout_overrides_native treats the remote layout as overriding the native one whenever remote_class_name != native_model_cls_name. Remote class names often differ from the transformers native class only in spelling, e.g. PhiMoEForCausalLM vs PhimoeForCausalLM.
A/B of the decision over all 149 local checkpoints that have an auto_map found 6 that flipped from native (def6e61) to remote (HEAD):
Even when the remote code imports cleanly, the remote module tree may not match the GPTQModel definition, which was written for the native tree.
Expected: prefer remote code only on a real layout mismatch (like the Ling MLA marker), not on any difference in class name.
Found during an AI-assisted review (Claude Code, round 13) of 489aed6; repros were run at that commit (A/B against def6e61 where noted) on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
TypeError: 'NoneType' object is not subscriptable in remote LlamaRotaryEmbedding(rope_config) (def6e61: loads native)
The repo's own test now fails.tests/models/test_minimax_m2.py sets TRUST_REMOTE_CODE=True, so it fails at load.
Users following the model card hit it. Phi-3.5-MoE's model card tells users to pass trust_remote_code=True.
Possible fix. A case-insensitive class-name comparison would avoid the Phi/MPT cases. Relying only on real layout markers (e.g. q_lora_rank) would avoid all of them. Note that MiniMax-M2 vs MiniMax differ by more than case.
Activity
Qubitium commentedon Nov 16, 2026
An independent reviewer confirmed this at 489aed6. More detail:
auto_map)PhiMoEForCausalLMPhimoeForCausalLMImportError: This modeling file requires ... flash_attn(def6e61: loads native)MPTForCausalLMMptForCausalLMImportError: cannot import name 'LlamaDynamicNTKScalingRotaryEmbedding'MiniMaxM2ForCausalLMMiniMaxForCausalLM(local MiniMax-M2-bf16, model_typeminimax)TypeError: 'NoneType' object is not subscriptablein remoteLlamaRotaryEmbedding(rope_config)(def6e61: loads native)tests/models/test_minimax_m2.pysetsTRUST_REMOTE_CODE=True, so it fails at load.trust_remote_code=True.q_lora_rank) would avoid all of them. Note that MiniMax-M2 vs MiniMax differ by more than case.(AI-assisted review, round 13 at
489aed6)fix: native class for natively supported remote-code checkpoints; kee…