[Bugfix][Multimodal] Avoid caching full prompts in fallback (#54439)

Signed-off-by: waizuichougou <2082431897@qq.com> Co-authored-by: OpenAI Codex <noreply@openai.com>

waizuichougou committed Aug 31, 2026 at 00:19 UTC f6895a5fcb4710481bb44726af4fa57f4172330c
1 file changed +3 -6
vllm/multimodal/processing/processor.py
+3 -6
@@ -1559,14 +1559,11 @@ class BaseMultiModalProcessor(ABC, Generic[_I]):
1559 # let BPE merge tokens across a segment boundary, silently
1560 # changing how a non-special-token placeholder is tokenized.
1561 new_token_ids = flatten_2d_lists(
1562 - [
1563 - cached_encode(tokenizer, text, add_special_tokens=False)
1564 - for text in out_texts
1565 - ]
1562 + [tokenizer.encode(text, add_special_tokens=False) for text in out_texts]
1563 )
1564 else:
1568 - new_token_ids = cached_encode(
1569 - tokenizer, "".join(out_texts), add_special_tokens=False
1565 + new_token_ids = tokenizer.encode(
1566 + "".join(out_texts), add_special_tokens=False
1567 )
1568
1569 return new_token_ids, result