Skip to content

Commit

Permalink
bugfix: rfind
Browse files Browse the repository at this point in the history
  • Loading branch information
gaozixiang committed Nov 14, 2024
1 parent 5dd35f4 commit 92cef83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lmdeploy/serve/async_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ def parse_tool_response(self, text, tools, **kwargs):
if not text.startswith('<tool_call>'):
text = text[:text.find('<tool_call>')]
elif not text.endswith('</tool_call>'):
text = text[text.find('</tool_call>') + len('</tool_call>'):]
text = text[text.rfind('</tool_call>') + len('</tool_call>'):]
else:
text = ''

Expand Down

0 comments on commit 92cef83

Please sign in to comment.