fix: skip qwen3_5_text checkpoint remap for nested VL language_model#45256
Open
zozo123 wants to merge 2 commits intohuggingface:mainfrom
Open
fix: skip qwen3_5_text checkpoint remap for nested VL language_model#45256zozo123 wants to merge 2 commits intohuggingface:mainfrom
zozo123 wants to merge 2 commits intohuggingface:mainfrom
Conversation
…trunk When saving a Qwen3.5 VL model via save_pretrained, the revert_weight_conversion for qwen3_5_text replaces a leading "model." segment. This wrongly matches keys that already start with "model.language_model." on composite VL models, duplicating the language_model prefix in the saved safetensors keys. Skip the qwen3_5_text remap when the submodule is the nested model.language_model trunk. For qwen3_5_moe_text inside MoE VL models, apply only the qwen2_moe conversions. Add a regression test verifying save_pretrained does not produce keys with triple-nested language_model segments. Fixes huggingface#45216
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: qwen3_5 |
Contributor
|
View the CircleCI Test Summary for this PR: https://huggingface.co/spaces/transformers-community/circle-ci-viz?pr=45256&sha=ec19be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When saving a Qwen3.5 VL model via
save_pretrained, therevert_weight_conversionforqwen3_5_textreplaces a leadingmodel.segment. This wrongly matches keys that already start withmodel.language_model.on composite VL models, duplicating thelanguage_modelprefix in the saved safetensors keys.Fixes #45216
Changes
get_model_conversion_mapping(), detect when aqwen3_5_textsubmodule is the nestedmodel.language_modeltrunk in a VL modelrevert_weight_conversionqwen3_5_moe_textinside MoE VL models, apply onlyqwen2_moeconversionssave_pretraineddoes not produce keys with triple-nestedlanguage_modelsegmentsTesting
test_save_pretrained_no_triple_nested_language_model_prefixintest_modeling_qwen3_5.pyQwen3_5ForConditionalGenerationmodel and asserts no key containslanguage_model.language_model.language_modelBuilt autonomously by islo.dev