From 5882a91bcf43d90b8e48788c6a4321e7bbf53075 Mon Sep 17 00:00:00 2001 From: cedonley Date: Fri, 29 Nov 2024 23:17:57 +0000 Subject: [PATCH] [Bugfix] Fixed Mistral tool streaming with non-ascii characters Signed-off-by: cedonley --- vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py b/vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py index 23916cae99752..ffb7ec0ef8287 100644 --- a/vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py +++ b/vllm/entrypoints/openai/tool_parsers/mistral_tool_parser.py @@ -260,7 +260,8 @@ def extract_tool_calls_streaming( "mid-arguments") delta = None elif cur_arguments and not prev_arguments: - cur_arguments_json = json.dumps(cur_arguments)[:-2] + cur_arguments_json = json.dumps(cur_arguments, + ensure_ascii=False)[:-2] logger.debug("finding %s in %s", new_text, cur_arguments_json)