mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2025-12-14 00:05:36 +08:00
[Bugfix]: correctly propagate errors message caught at the chat_templating step to the client (#18769)
Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com>
This commit is contained in:
parent
3e9ce609bd
commit
9a21e331ff
@ -1252,7 +1252,7 @@ def apply_hf_chat_template(
|
|||||||
# investigation.
|
# investigation.
|
||||||
logger.exception(
|
logger.exception(
|
||||||
"An error occurred in `transformers` while applying chat template")
|
"An error occurred in `transformers` while applying chat template")
|
||||||
raise ValueError from e
|
raise ValueError(str(e)) from e
|
||||||
|
|
||||||
def apply_mistral_chat_template(
|
def apply_mistral_chat_template(
|
||||||
tokenizer: MistralTokenizer,
|
tokenizer: MistralTokenizer,
|
||||||
@ -1281,7 +1281,7 @@ def apply_mistral_chat_template(
|
|||||||
# We convert those assertion errors to ValueErrors so they can be
|
# We convert those assertion errors to ValueErrors so they can be
|
||||||
# are properly caught in the preprocessing_input step
|
# are properly caught in the preprocessing_input step
|
||||||
except (AssertionError, MistralCommonException) as e:
|
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
|
# External library exceptions can sometimes occur despite the framework's
|
||||||
# internal exception management capabilities.
|
# internal exception management capabilities.
|
||||||
@ -1292,7 +1292,7 @@ def apply_mistral_chat_template(
|
|||||||
logger.exception(
|
logger.exception(
|
||||||
"An error occurred in `mistral_common` while applying chat "
|
"An error occurred in `mistral_common` while applying chat "
|
||||||
"template")
|
"template")
|
||||||
raise ValueError from e
|
raise ValueError(str(e)) from e
|
||||||
|
|
||||||
def random_tool_call_id() -> str:
|
def random_tool_call_id() -> str:
|
||||||
return f"chatcmpl-tool-{random_uuid()}"
|
return f"chatcmpl-tool-{random_uuid()}"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user