From 2f454823a6e24186247af01cef01a7283106760f Mon Sep 17 00:00:00 2001 From: tzhouam Date: Wed, 9 Sep 2026 23:49:04 +0800 Subject: [PATCH] refactor(qwen3_omni): inherit _maybe_apply_prompt_updates from the Qwen2.5-Omni processor The vLLM 0.29 rewrite left Qwen3OmniMoeThinkerMultiModalProcessor with a _maybe_apply_prompt_updates that is identical to the one on its first base, Omni's Qwen2_5OmniThinkerMultiModalProcessor (same body modulo docstring). The MRO is Omni Qwen3 -> Omni Qwen2.5 -> upstream Qwen3 -> upstream Qwen2.5 -> BaseMultiModalProcessor, so deleting the override resolves to the same code; asserted with Qwen3OmniMoeThinkerMultiModalProcessor._maybe_apply_prompt_updates is Qwen2_5OmniThinkerMultiModalProcessor._maybe_apply_prompt_updates. Validation: ruff and pre-commit on the file; the MRO assertion above; tests/model_executor/models/{qwen3_omni,qwen2_5_omni} pass (20 + 81 tests). Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01MpXe2LeRrUQGjZfKFaocMZ Signed-off-by: tzhouam --- .../qwen3_omni/qwen3_omni_moe_thinker.py | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/vllm_omni/model_executor/models/qwen3_omni/qwen3_omni_moe_thinker.py b/vllm_omni/model_executor/models/qwen3_omni/qwen3_omni_moe_thinker.py index 8329bbc91..b2a7d7abe 100644 --- a/vllm_omni/model_executor/models/qwen3_omni/qwen3_omni_moe_thinker.py +++ b/vllm_omni/model_executor/models/qwen3_omni/qwen3_omni_moe_thinker.py @@ -705,47 +705,6 @@ class Qwen3OmniMoeThinkerMultiModalProcessor( # Preserve Omni's per-video overrides while inheriting upstream Qwen3's # audio processing through the shared, cooperative Qwen2.5 base. - def _maybe_apply_prompt_updates( - self, - mm_items: MultiModalDataItems, - prompt_ids: list[int], - mm_kwargs: MultiModalKwargsItems, - mm_prompt_updates: MultiModalPromptUpdates, - ) -> tuple[list[int], Mapping[str, list[PlaceholderFeaturesInfo]]]: - """ - Qwen3-Omni reimplements this function to handle `use_audio_in_video`. - """ - mm_item_counts = mm_items.get_all_counts() - self._validate_mm_kwargs(mm_kwargs, mm_item_counts) - self._validate_mm_updates(mm_prompt_updates, mm_item_counts) - - video_use_audio_in_video = self._get_video_use_audio_in_video(mm_kwargs, mm_prompt_updates) - use_audio_in_video = any(video_use_audio_in_video) - - if use_audio_in_video and "audio" in mm_prompt_updates: - filtered_updates = {k: v for k, v in mm_prompt_updates.items() if k != "audio"} - prompt_ids, mm_placeholders = self._apply_prompt_updates( - prompt_ids, - filtered_updates, - ) - mm_placeholders = self._derive_audio_from_video_placeholders( - mm_placeholders, - mm_prompt_updates, - video_use_audio_in_video, - ) - else: - prompt_ids, mm_placeholders = self._apply_prompt_updates( - prompt_ids, - mm_prompt_updates, - ) - - self._validate_mm_placeholders( - mm_placeholders, - mm_item_counts, - ) - - return prompt_ids, mm_placeholders - def get_updates_use_audio_in_video( self, thinker_config: PretrainedConfig,