@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 8865da157b
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 14, 05:30 UTC

[Bugfix][Multi Modal] Fix incorrect Molmo token processing (#26873)

Signed-off-by: sanghol <sanghol@allenai.org>

sangho.lee committed Oct 15, 2025 at 02:13 UTC 8865da157bea1b25afc4ff28031858d557363290
1 file changed +5 -2
vllm/model_executor/models/molmo.py
+5 -2
@@ -1264,13 +1264,16 @@ class MolmoMultiModalProcessor(BaseMultiModalProcessor[MolmoProcessingInfo]):
1264 ) -> list[int]:
1265 processor = self.info.get_hf_processor()
1266
1267 - # Apply the chat template to the tokens
1267 + # The chat template is already applied to the prompt tokens
1268 + # Use message_format="none" to avoid applying it again
1269 + # Prepend an empty space if `always_start_with_space` is True
1270 tokens = processor.processor.get_tokens_input( # type: ignore
1271 self.info.get_tokenizer().decode(prompt_tokens),
1270 - message_format=processor.message_format,
1272 + message_format="none",
1273 always_start_with_space=processor.always_start_with_space,
1274 )
1275
1276 + # Prepend a BOS token id to the tokens
1277 processed_data = self.info.ctx.call_hf_processor(
1278 processor, # type: ignore
1279 dict(tokens=tokens),