diff --git a/vllm/model_executor/models/qwen3_5.py b/vllm/model_executor/models/qwen3_5.py index 5c76bf7ef3..67edae54fd 100644 --- a/vllm/model_executor/models/qwen3_5.py +++ b/vllm/model_executor/models/qwen3_5.py @@ -676,9 +676,10 @@ class Qwen3_5ForCausalLMBase( super().__init__() self.config = config self.scheduler_config = scheduler_config - self.model = Qwen3_5Model( - vllm_config=vllm_config, prefix=maybe_prefix(prefix, "model") - ) + # Deal with the case where the prefix is already "language_model" since + # Qwen/Qwen3.5-397B-A17B has naming like: model.language_model.layers.0 + model_prefix = prefix if "model" in prefix else "model" + self.model = Qwen3_5Model(vllm_config=vllm_config, prefix=model_prefix) if get_pp_group().is_last_rank: if config.tie_word_embeddings: @@ -754,7 +755,7 @@ class Qwen3_5MoeForCausalLM(Qwen3_5ForCausalLMBase, QwenNextMixtureOfExperts): dummy_inputs=Qwen3VLDummyInputsBuilder, ) class Qwen3_5ForConditionalGeneration(Qwen3VLForConditionalGeneration, IsHybrid): - def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""): + def __init__(self, *, vllm_config: VllmConfig, prefix: str = "model"): # protocols have not __init__ method, so we need to use nn.Module.__init__ nn.Module.__init__(self) config: Qwen3_5Config = vllm_config.model_config.hf_config @@ -962,7 +963,7 @@ class Qwen3_5_MoeMixtureOfExperts(MixtureOfExperts): class Qwen3_5MoeForConditionalGeneration( Qwen3_5ForConditionalGeneration, Qwen3_5_MoeMixtureOfExperts ): - def __init__(self, *, vllm_config: VllmConfig, prefix: str = ""): + def __init__(self, *, vllm_config: VllmConfig, prefix: str = "model"): # protocols have not __init__ method, so we need to use nn.Module.__init__ nn.Module.__init__(self) config: Qwen3_5MoeConfig = vllm_config.model_config.hf_config