@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / 9a21e331ff
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 15, 08:30 UTC

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

Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com>

Guillaume Calmettes committed May 28, 2025 at 05:35 UTC 9a21e331ff8c4ab052a654b3ebd9f67ddfff4845
1 file changed +3 -3
vllm/entrypoints/chat_utils.py
+3 -3
@@ -1252,7 +1252,7 @@ def apply_hf_chat_template(
1252 # investigation.
1253 logger.exception(
1254 "An error occurred in `transformers` while applying chat template")
1255 - raise ValueError from e
1255 + raise ValueError(str(e)) from e
1256
1257 def apply_mistral_chat_template(
1258 tokenizer: MistralTokenizer,
@@ -1281,7 +1281,7 @@ def apply_mistral_chat_template(
1281 # We convert those assertion errors to ValueErrors so they can be
1282 # are properly caught in the preprocessing_input step
1283 except (AssertionError, MistralCommonException) as e:
1284 - raise ValueError from e
1284 + raise ValueError(str(e)) from e
1285
1286 # External library exceptions can sometimes occur despite the framework's
1287 # internal exception management capabilities.
@@ -1292,7 +1292,7 @@ def apply_mistral_chat_template(
1292 logger.exception(
1293 "An error occurred in `mistral_common` while applying chat "
1294 "template")
1295 - raise ValueError from e
1295 + raise ValueError(str(e)) from e
1296
1297 def random_tool_call_id() -> str:
1298 return f"chatcmpl-tool-{random_uuid()}"