Skip to content

fix: propagate num_labels to text_config for Qwen models#44714

Open
LincolnBurrows2017 wants to merge 3 commits intohuggingface:mainfrom
LincolnBurrows2017:fix-qwen-num-labels-propagation
Open

fix: propagate num_labels to text_config for Qwen models#44714
LincolnBurrows2017 wants to merge 3 commits intohuggingface:mainfrom
LincolnBurrows2017:fix-qwen-num-labels-propagation

Conversation

@LincolnBurrows2017
Copy link

Summary

Fixes issue #44625: Qwen3.5 num_labels not propagating from core config to text_config.

When calling AutoConfig.from_pretrained("Qwen3.5", num_labels=1), the main config gets num_labels=1 but text_config still has default value 2. This breaks sequence classification.

Changes

Added propagation of num_labels, id2label, and label2id to text_config in:

  • src/transformers/models/qwen3_5/configuration_qwen3_5.py
  • src/transformers/models/qwen3_vl/configuration_qwen3_vl.py
  • src/transformers/models/qwen3_vl/modular_qwen3_vl.py

@github-actions
Copy link
Contributor

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

run-slow: doge, qwen2_5_vl, qwen2_vl, qwen3_5, qwen3_vl

@github-actions
Copy link
Contributor

View the CircleCI Test Summary for this PR:

https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=44714&sha=3d3ebb

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.

1 participant