mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-06-04 09:42:17 +08:00
[Bugfix] catch AssertionError in MistralTokenizer as ValueError (#16344)
Signed-off-by: Guillaume Calmettes <gcalmettes@scaleway.com>
This commit is contained in:
parent
a25866ac8d
commit
c3b5189137
@ -1193,8 +1193,15 @@ def apply_mistral_chat_template(
|
|||||||
**kwargs,
|
**kwargs,
|
||||||
)
|
)
|
||||||
|
|
||||||
return tokenizer.apply_chat_template(
|
try:
|
||||||
messages=messages,
|
return tokenizer.apply_chat_template(
|
||||||
tools=tools,
|
messages=messages,
|
||||||
**kwargs,
|
tools=tools,
|
||||||
)
|
**kwargs,
|
||||||
|
)
|
||||||
|
# mistral-common uses assert statements to stop processing of input
|
||||||
|
# if input does not comply with the expected format.
|
||||||
|
# We convert those assertion errors to ValueErrors so they can be
|
||||||
|
# are properly caught in the preprocessing_input step
|
||||||
|
except AssertionError as e:
|
||||||
|
raise ValueError from e
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user