Skip to content

Commit 9a21e33

Browse files
authored
[Bugfix]: correctly propagate errors message caught at the chat_templating step to the client (vllm-project#18769)
Signed-off-by: Guillaume Calmettes <[email protected]>
1 parent 3e9ce60 commit 9a21e33

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vllm/entrypoints/chat_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ def apply_hf_chat_template(
12521252
# investigation.
12531253
logger.exception(
12541254
"An error occurred in `transformers` while applying chat template")
1255-
raise ValueError from e
1255+
raise ValueError(str(e)) from e
12561256

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

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

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

0 commit comments

Comments
 (0)