Skip to content

Commit 95520ef

Browse files
committed
[Bugfix] Fix the bug in Hermes streaming parsing
Signed-off-by: zxy <zx0823y@163.com>
1 parent 41d5af9 commit 95520ef

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

requirements/common.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ lark == 1.2.2
2828
xgrammar == 0.1.19; platform_machine == "x86_64" or platform_machine == "aarch64" or platform_machine == "arm64"
2929
typing_extensions >= 4.10
3030
filelock >= 3.16.1 # need to contain https://github.com/tox-dev/filelock/pull/317
31+
json_repair # used for repairing JSON outputs
3132
partial-json-parser # used for parsing partial JSON outputs
3233
pyzmq >= 25.0.0
3334
msgspec

vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import partial_json_parser
99
import regex as re
10-
from partial_json_parser.core.options import Allow
1110
from json_repair import repair_json
1211

1312
from vllm.entrypoints.chat_utils import random_tool_call_id
@@ -171,6 +170,7 @@ def extract_tool_calls_streaming(
171170
# something with tools with this diff.
172171
# flags for partial JSON parting. exported constants from
173172
# "Allow" are handled via BIT MASK
173+
from partial_json_parser.core.options import Allow
174174
flags = Allow.ALL if self.current_tool_name_sent \
175175
else Allow.ALL & ~Allow.STR
176176

0 commit comments

Comments
 (0)