[Bugfix] Always apply MM processor even when no MM items are passed (#26240)

Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk>
This commit is contained in:
Cyrus Leung
2025-10-05 10:10:20 +00:00
committed by GitHub
parent 432e1cbc23
commit b7e8e4e6be
6 changed files with 102 additions and 30 deletions
+2 -2
View File
@@ -507,8 +507,8 @@ class Phi3VMultiModalProcessor(BaseMultiModalProcessor[Phi3VProcessingInfo]):
)
# Keep the behavior in line with HF processor
if token_ids[:2] == tokenizer.encode("<s> <|image|>",
add_special_tokens=False):
if len(mm_prompt_updates) and (token_ids[:2] == tokenizer.encode(
"<s> <|image|>", add_special_tokens=False)):
token_ids = [token_ids[0], *token_ids[2:]]
placeholders = {
modality: [
@@ -331,6 +331,7 @@ class Qwen2_5OmniThinkerMultiModalProcessor(
"""
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)
use_audio_in_video = False
if "video" in mm_kwargs: