[Bugfix] Raise clear error on interleaved multimodal placeholder overcount (#53999)

Signed-off-by: hungh <hungh@nvidia.com>
This commit is contained in:
Hung Hoang (黄兴)
2026-08-27 09:49:40 +00:00
committed by GitHub
parent fd57c4b7af
commit acd0af90e8
2 changed files with 31 additions and 1 deletions
+7 -1
View File
@@ -1407,7 +1407,13 @@ def _get_interleaved_text_prompt(
) -> str:
for idx, elem in enumerate(texts):
if elem in placeholder_storage:
texts[idx] = placeholder_storage[elem].pop(0)
slots = placeholder_storage[elem]
if not slots:
raise VLLMValidationError(
f"Found more '{elem}' placeholders in input prompt than "
"actual multimodal data items."
)
texts[idx] = slots.pop(0)
return "\n".join(texts)