From deb9bd4efc385d20a54e3d2a63168c1381822969 Mon Sep 17 00:00:00 2001 From: Ayaka Mikazuki Date: Mon, 29 Jun 2026 15:34:27 +0800 Subject: [PATCH] Fix Qwen2.5-Omni AutoRound loading (#4781) Signed-off-by: Ayaka --- vllm_omni/model_executor/models/qwen2_5_omni/qwen2_5_omni.py | 1 + vllm_omni/model_executor/models/qwen2_5_omni/qwen2_old.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vllm_omni/model_executor/models/qwen2_5_omni/qwen2_5_omni.py b/vllm_omni/model_executor/models/qwen2_5_omni/qwen2_5_omni.py index 8d5341f3e..4bd48c043 100644 --- a/vllm_omni/model_executor/models/qwen2_5_omni/qwen2_5_omni.py +++ b/vllm_omni/model_executor/models/qwen2_5_omni/qwen2_5_omni.py @@ -81,6 +81,7 @@ class Qwen2_5OmniForConditionalGeneration( # Initialize thinker model (multimodal processing) self.thinker = init_vllm_registered_model( vllm_config=vllm_config, + prefix=maybe_prefix(prefix, "thinker"), hf_config=thinker_config, # Use registry architecture key architectures=["Qwen2_5OmniThinkerModel"], diff --git a/vllm_omni/model_executor/models/qwen2_5_omni/qwen2_old.py b/vllm_omni/model_executor/models/qwen2_5_omni/qwen2_old.py index 27eb25720..67806f951 100644 --- a/vllm_omni/model_executor/models/qwen2_5_omni/qwen2_old.py +++ b/vllm_omni/model_executor/models/qwen2_5_omni/qwen2_old.py @@ -335,11 +335,12 @@ class Qwen2Model(nn.Module): ("gate_up_proj", "up_proj", 1), ] params_dict = dict(self.named_parameters(remove_duplicate=False)) + get_cache_scale = getattr(self.quant_config, "get_cache_scale", None) loaded_params: set[str] = set() for name, loaded_weight in weights: if "rotary_emb.inv_freq" in name: continue - if self.quant_config is not None and (scale_name := self.quant_config.get_cache_scale(name)): + if get_cache_scale is not None and (scale_name := get_cache_scale(name)): # Loading kv cache quantization scales param = params_dict[scale_name] weight_loader = getattr(param, "weight_loader", default_weight_loader)