[Bugfix][Frontend] Raise VLLMValidationError for user-facing errors in chat_utils.py (#50491)
Signed-off-by: latent-9 <296084221+latent-9@users.noreply.github.com> Co-authored-by: latent-9 <296084221+latent-9@users.noreply.github.com>
This commit is contained in:
@@ -2092,7 +2092,7 @@ def test_parse_chat_messages_multiple_images_interleave_with_placeholders(
|
||||
image_url,
|
||||
):
|
||||
with pytest.raises(
|
||||
ValueError,
|
||||
VLLMValidationError,
|
||||
match=r"Found more '<|image_1|>' placeholders in input prompt "
|
||||
"than actual multimodal data items.",
|
||||
):
|
||||
|
||||
@@ -316,7 +316,7 @@ _PLACEHOLDER_ERROR_PATTERN: Final[str] = re.sub(
|
||||
def test_parse_chat_messages_rejects_placeholder_in_user_text(content):
|
||||
mc = _make_mock_model_config() # enable_prompt_embeds=True by default
|
||||
messages = [{"role": "user", "content": content}]
|
||||
with pytest.raises(ValueError, match=_PLACEHOLDER_ERROR_PATTERN):
|
||||
with pytest.raises(VLLMValidationError, match=_PLACEHOLDER_ERROR_PATTERN):
|
||||
parse_chat_messages(messages, mc, content_format="openai")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user