[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 18:10:20 +08:00
committed by GitHub
parent 432e1cbc23
commit b7e8e4e6be
6 changed files with 102 additions and 30 deletions

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: [