Skip to content

fix(config): add deepstack_visual_indexes to Qwen3_5MoeVisionConfig#45379

Open
hijingsong wants to merge 1 commit intohuggingface:mainfrom
hijingsong:clawoss/fix/deepstack-visual-indexes-qwen3-5-moe
Open

fix(config): add deepstack_visual_indexes to Qwen3_5MoeVisionConfig#45379
hijingsong wants to merge 1 commit intohuggingface:mainfrom
hijingsong:clawoss/fix/deepstack-visual-indexes-qwen3-5-moe

Conversation

@hijingsong
Copy link
Copy Markdown

Problem

The @strict decorator on Qwen3_5MoeVisionConfig silently drops the deepstack_visual_indexes field during config loading because it is not declared as a class attribute. Every Qwen3.5 MoE model on HuggingFace ships with this field in its config.json (e.g. Qwen/Qwen3.5-35B-A3B-Base).

Root Cause

Qwen3_5MoeVisionConfig inherits from Qwen3_5VisionConfig, which overrides deepstack_visual_indexes with an AttributeError() sentinel (inherited from the parent chain). The generated configuration_qwen3_5_moe.py does not include the field at all, so @strict rejects it when deserializing from config.json.

Fix

Override deepstack_visual_indexes as a properly typed class attribute on Qwen3_5MoeVisionConfig with default (), matching the type annotation used in Qwen3VLVisionConfig. This ensures:

  • The field is accepted when loading model configs
  • config.vision_config.deepstack_visual_indexes returns the value from config.json
  • No silent data loss during deserialization

Verification

from transformers import AutoConfig
config = AutoConfig.from_pretrained("Qwen/Qwen3.5-35B-A3B-Base", trust_remote_code=True)
print(config.vision_config.deepstack_visual_indexes)  # [] — no longer raises AttributeError

Fixes #45375

Changes

  • modular_qwen3_5_moe.py: Add deepstack_visual_indexes field override with docstring
  • configuration_qwen3_5_moe.py: Add deepstack_visual_indexes field with docstring (generated)

The @strict decorator on Qwen3_5MoeVisionConfig silently dropped the
deepstack_visual_indexes field during config loading because it was not
declared as a class attribute. Every Qwen3.5 MoE model ships with this
field in its config.json (e.g. Qwen/Qwen3.5-35B-A3B-Base).

Override the AttributeError sentinel inherited from Qwen3_5VisionConfig
with a proper typed field defaulting to an empty tuple.

Fixes huggingface#45375
@github-actions
Copy link
Copy Markdown
Contributor

[For maintainers] Suggested jobs to run (before merge)

run-slow: qwen3_5_moe

@Rocketknight1
Copy link
Copy Markdown
Member

cc @zucchini-nlp, more stuff related to #41250!

@zucchini-nlp
Copy link
Copy Markdown
Member

@hijingsong see the comment under issue, not reproducible for me so I am guessing something is different env-setup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Qwen3_5MoeVisionConfig missing deepstack_visual_indexes field — silently dropped by @strict

3 participants