Skip to content

[Bugfix]: correctly propagate errors message caught at the chat_templating step to the client #18769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions vllm/entrypoints/chat_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ def apply_hf_chat_template(
# investigation.
logger.exception(
"An error occurred in `transformers` while applying chat template")
raise ValueError from e
raise ValueError(str(e)) from e

def apply_mistral_chat_template(
tokenizer: MistralTokenizer,
Expand Down Expand Up @@ -1281,7 +1281,7 @@ def apply_mistral_chat_template(
# We convert those assertion errors to ValueErrors so they can be
# are properly caught in the preprocessing_input step
except (AssertionError, MistralCommonException) as e:
raise ValueError from e
raise ValueError(str(e)) from e

# External library exceptions can sometimes occur despite the framework's
# internal exception management capabilities.
Expand All @@ -1292,7 +1292,7 @@ def apply_mistral_chat_template(
logger.exception(
"An error occurred in `mistral_common` while applying chat "
"template")
raise ValueError from e
raise ValueError(str(e)) from e

def random_tool_call_id() -> str:
return f"chatcmpl-tool-{random_uuid()}"