Skip to content

Commit

Permalink
fix: content信息返回
Browse files Browse the repository at this point in the history
  • Loading branch information
gaozixiang committed Nov 11, 2024
1 parent 4db0e4b commit 61d3df8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lmdeploy/serve/async_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,9 +652,13 @@ def parse_tool_response(self, text, tools, **kwargs):
action, _ = text.split('</function>')
parameters = action[action.find('{'):]
name = action.split('<function=')[1].split('>{')[0]
elif '<tool_call>' in text: #qwen2.5
elif '<tool_call>' in text: # qwen2.5
action = text.split('</tool_call>')[0]
text, action = action.split('<tool_call>')
action = action.split('<tool_call>')
if len(action) == 1:
text, action = '', action[0]
else:
text, action = action
action = json.loads(action)
name, parameters = action['name'], json.dumps(action.get('parameters', action.get('arguments', {})))
else:
Expand Down

0 comments on commit 61d3df8

Please sign in to comment.