Skip to content

Commit 1c2478d

Browse files
committed
[Bug]: Hermes tool parser stream output error in Qwen3 case #19056
Signed-off-by: liuli <[email protected]>
1 parent 17430e3 commit 1c2478d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,10 @@ def extract_tool_calls_streaming(
340340

341341
# last case -- we have an update to existing arguments.
342342
elif cur_arguments and prev_arguments:
343-
if isinstance(delta_text, str) and len(delta_text.rstrip(
344-
)) >= 1 and delta_text.rstrip()[-1] == '}':
343+
if isinstance(delta_text, str) \
344+
and len(delta_text.rstrip()) >= 2 \
345+
and delta_text.rstrip()[-1] == '}' \
346+
and delta_text.rstrip()[-2] == '}':
345347
delta_text = delta_text.rstrip()[:-1]
346348

347349
logger.debug("got diff %s", delta_text)

0 commit comments

Comments
 (0)