Skip to content

Conversation

@zucchini-nlp
Copy link
Member

@zucchini-nlp zucchini-nlp commented Nov 26, 2025

What does this PR do?

As per title, break the cycle. Qwen will no longer have access to text attributes with config.vocab_size which solves the duplicated attribute issue we had in TRL. A config should not have two different values for the same key

Tested with the TRL issue that there is no regression and ran slow test locally

@zucchini-nlp
Copy link
Member Author

run-slow: qwen2_5_vl, qwen2_vl

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs:

models: ["models/qwen2_5_vl", "models/qwen2_vl"]
quantizations: []

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@github-actions
Copy link
Contributor

CI Results

Workflow Run ⚙️

✅ No failing test specific to this PR 🎉 !

@zucchini-nlp
Copy link
Member Author

run-slow: qwen2_5_vl, qwen2_vl

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs:

models: ["models/qwen2_5_vl", "models/qwen2_vl"]
quantizations: []

@github-actions
Copy link
Contributor

CI Results

Workflow Run ⚙️

Model CI Report

❌ Failed tests

  • qwen2_5_vl:
    tests/models/qwen2_5_vl/test_modeling_qwen2_5_vl.py::Qwen2_5_VLIntegrationTest::test_small_model_integration_test
    tests/models/qwen2_5_vl/test_modeling_qwen2_5_vl.py::Qwen2_5_VLIntegrationTest::test_small_model_integration_test_batch
    tests/models/qwen2_5_vl/test_modeling_qwen2_5_vl.py::Qwen2_5_VLIntegrationTest::test_small_model_integration_test_batch_wo_image
    tests/models/qwen2_5_vl/test_modeling_qwen2_5_vl.py::Qwen2_5_VLIntegrationTest::test_small_model_integration_test_expand

  • qwen2_vl:
    tests/models/qwen2_vl/test_modeling_qwen2_vl.py::Qwen2VLIntegrationTest::test_small_model_integration_test
    tests/models/qwen2_vl/test_modeling_qwen2_vl.py::Qwen2VLIntegrationTest::test_small_model_integration_test_batch
    tests/models/qwen2_vl/test_modeling_qwen2_vl.py::Qwen2VLIntegrationTest::test_small_model_integration_test_batch_different_resolutions
    tests/models/qwen2_vl/test_modeling_qwen2_vl.py::Qwen2VLIntegrationTest::test_small_model_integration_test_batch_wo_image
    tests/models/qwen2_vl/test_modeling_qwen2_vl.py::Qwen2VLIntegrationTest::test_small_model_integration_test_expand

@zucchini-nlp
Copy link
Member Author

run-slow: qwen2_5_vl, qwen2_vl

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs:

models: ["models/qwen2_5_vl", "models/qwen2_vl"]
quantizations: []

@zucchini-nlp
Copy link
Member Author

run-slow: qwen2_5_vl, qwen2_vl

2 similar comments
@zucchini-nlp
Copy link
Member Author

run-slow: qwen2_5_vl, qwen2_vl

@zucchini-nlp
Copy link
Member Author

run-slow: qwen2_5_vl, qwen2_vl

Comment on lines +305 to +309
# Hub configs are saved as flat dicts so we pop some of kwargs to init `TextConfig`
text_params = inspect.signature(self.sub_configs["text_config"].__init__).parameters.keys()
text_params = list(text_params) + ["rope_scaling", "rope_theta"]
text_config = {key: kwargs.pop(key) for key in text_params if key in kwargs}
text_config["dtype"] = kwargs.get("torch_dtype", kwargs.get("dtype")) # don't pop the dtype
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the best way, i should admit. The problem is that config will assign all kwargs as attributes, and if we don't pop we end up with the same set of kwargs in text config and in the general config

@github-actions
Copy link
Contributor

CI Results

Workflow Run ⚙️

⚠️ No test being reported (jobs are skipped or cancelled)!

@github-actions
Copy link
Contributor

This comment contains run-slow, running the specified jobs:

models: ["models/qwen2_5_vl", "models/qwen2_vl"]
quantizations: []

@github-actions
Copy link
Contributor

CI Results

Workflow Run ⚙️

✅ No failing test specific to this PR 🎉 !

@albertvillanova
Copy link
Member

Thanks for addressing this issue, @zucchini-nlp. 🤗

For completeness, here is the original issue we opened in TRL that tracked this problem:

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks let's add a note in the migration guide please!

@zucchini-nlp zucchini-nlp enabled auto-merge (squash) November 27, 2025 15:17
@github-actions
Copy link
Contributor

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

run-slow: qwen2_5_vl, qwen2_vl

@zucchini-nlp zucchini-nlp merged commit 9bdec65 into huggingface:main Nov 27, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants