[Model] Fix weight prefix mapping for native Qwen3.5 text-only checkp… (#50355)

Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
Co-authored-by: opencode <opencode@anomaly.co>
This commit is contained in:
zofia
2026-08-06 07:40:44 +00:00
committed by GitHub
co-authored by opencode
parent 470297c143
commit febea17f6a
2 changed files with 13 additions and 2 deletions
+8 -1
View File
@@ -303,6 +303,13 @@ class Qwen3_5ForCausalLMBase(
"in_proj_ba": ["in_proj_b", "in_proj_a"],
}
# Some community text-only checkpoints keep the extraneous
# `model.language_model.` prefix inherited from the VL training stack.
# Strip it so both prefixed and clean checkpoints load correctly.
hf_to_vllm_mapper = WeightsMapper(
orig_to_new_prefix={"model.language_model.": "model."},
)
def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""):
config = vllm_config.model_config.hf_text_config
self.vllm_config = vllm_config
@@ -416,7 +423,7 @@ class Qwen3_5ForCausalLMBase(
self,
skip_prefixes=["mtp."],
)
return loader.load_weights(weights)
return loader.load_weights(weights, mapper=self.hf_to_vllm_mapper)
class Qwen3_5ForCausalLM(Qwen3_5ForCausalLMBase):