Skip to content

Commit c23cd3d

Browse files
committed
[Bugfix] improve regex for hermes tool detection
Signed-off-by: Adrien <adrien@huggingface.co>
1 parent 5adff7c commit c23cd3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

vllm/entrypoints/openai/tool_parsers/hermes_tool_parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, tokenizer: AnyTokenizer):
4444
self.tool_call_end_token: str = "</tool_call>"
4545

4646
self.tool_call_regex = re.compile(
47-
r"<tool_call>(.*?)</tool_call>|<tool_call>(.*)", re.DOTALL)
47+
r"(?:<tool_call>)+(.*?)</tool_call>|<tool_call>(.*)", re.DOTALL)
4848
self.scratch_pad_regex = re.compile(
4949
r"<scratch_pad>(.*?)</scratch_pad>", re.DOTALL)
5050

0 commit comments

Comments
 (0)