[Bugfix][Frontend] Validate mixed prompt embedding mask lengths (#57006)

Signed-off-by: 子华 <huaxi.shx@alibaba-inc.com>
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
shaohuaxi
2026-09-22 05:50:31 +00:00
committed by GitHub
co-authored by Codex
parent 4800024b98
commit 5abf85d27a
2 changed files with 75 additions and 4 deletions
+9
View File
@@ -540,6 +540,15 @@ class InputProcessor:
prompt_len = length_from_prompt_token_ids_or_embeds(prompt_ids, prompt_embeds)
self._validate_prompt_len(prompt_len, prompt_type)
if prompt_input["type"] == "embeds":
is_token_ids = prompt_input.get("is_token_ids")
if is_token_ids is not None and len(is_token_ids) != prompt_len:
raise VLLMValidationError(
"prompt_is_token_ids must have the same length as prompt_embeds "
f"(expected {prompt_len}, got {len(is_token_ids)}).",
parameter="prompt_is_token_ids",
)
if prompt_input["type"] == "multimodal":
decoder_mm_positions = prompt_input["mm_placeholders"]
for modality, mm_positions in decoder_mm_positions.items():