Skip to content

fix Qwen3_5MoeVisionConfig deepstack_visual_indexes silently dropped by @strict (Issue: https://github.com/huggingface/transformers/issues/45375)#45380

Closed
Brianzhengca wants to merge 1 commit intohuggingface:mainfrom
Brianzhengca:fix_Qwen3_5MoeVisionConfig_deepstack_visual_indexes
Closed

fix Qwen3_5MoeVisionConfig deepstack_visual_indexes silently dropped by @strict (Issue: https://github.com/huggingface/transformers/issues/45375)#45380
Brianzhengca wants to merge 1 commit intohuggingface:mainfrom
Brianzhengca:fix_Qwen3_5MoeVisionConfig_deepstack_visual_indexes

Conversation

@Brianzhengca
Copy link
Copy Markdown

What does this PR do?

Fixes #45375 (issue)

Root Cause

In modular_qwen3_5.py, Qwen3_5VisionConfig was marked @strict but also had deepstack_visual_indexes = AttributeError(). That meant the field was effectively undeclared for strict loading, so when a real checkpoint config included "deepstack_visual_indexes": [], Transformers silently dropped it during config construction. Since Qwen3_5MoeVisionConfig inherits that shared Qwen3.5 vision config shape, the bug affected both plain Qwen3.5 and Qwen3.5-MoE configs.

Fix

I restored deepstack_visual_indexes as a real config attribute in modular_qwen3_5.py, with an empty default so Qwen3.5 keeps deepstack disabled by default.

Tests

from transformers import Qwen3_5Config, Qwen3_5MoeConfig

for cls in [Qwen3_5Config, Qwen3_5MoeConfig]:
    config = cls(vision_config={"deepstack_visual_indexes": [1, 2]})
    print(
        cls.__name__,
        type(config.vision_config.deepstack_visual_indexes).__name__,
        config.vision_config.deepstack_visual_indexes,
    )

Output:

Qwen3_5MoeConfig list [1, 2]

@github-actions
Copy link
Copy Markdown
Contributor

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

run-slow: qwen3_5, qwen3_5_moe

@Brianzhengca
Copy link
Copy Markdown
Author

Just realized the issue already has a PR that fixes it, my bad. Closing.

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

2 participants