From 25e5b9ccec41561bfcf473d8ca908d76503a61bc Mon Sep 17 00:00:00 2001 From: Wenlong Wang Date: Wed, 1 Oct 2025 01:03:25 -0700 Subject: [PATCH] [BugFix][MM] Fix Nonetype error when video is cache in qwen2.5-omni-thinker (#26004) Signed-off-by: wwl2755 Signed-off-by: yewentao256 --- vllm/model_executor/models/qwen2_5_omni_thinker.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/vllm/model_executor/models/qwen2_5_omni_thinker.py b/vllm/model_executor/models/qwen2_5_omni_thinker.py index 8f069710b0f92..b5e82c9b21cd1 100644 --- a/vllm/model_executor/models/qwen2_5_omni_thinker.py +++ b/vllm/model_executor/models/qwen2_5_omni_thinker.py @@ -323,9 +323,15 @@ class Qwen2_5OmniThinkerMultiModalProcessor( mm_item_counts = mm_items.get_all_counts() self._validate_mm_kwargs(mm_kwargs, mm_item_counts) - use_audio_in_video = (all( - item["use_audio_in_video"].data - for item in mm_kwargs["video"]) if "video" in mm_kwargs else False) + use_audio_in_video = False + if "video" in mm_kwargs: + video_items = [ + item for item in mm_kwargs["video"] if item is not None + ] + # only check video items (if there are any) + if video_items: + use_audio_in_video = all(item["use_audio_in_video"].data + for item in video_items) if is_update_applied: mm_placeholders = self._find_mm_placeholders(