Skip to content

Commit

Permalink
fix: handle multiple calls to the same tool
Browse files Browse the repository at this point in the history
Fixes abetlen#1756

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
  • Loading branch information
jeffmaury committed Sep 24, 2024
1 parent 4744551 commit c9c7337
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion llama_cpp/llama_chat_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -3714,7 +3714,7 @@ def chatml_function_calling(
)
response = cast(llama_types.CreateCompletionResponse, response)

tool_name = response["choices"][0]["text"][len("functions.") :]
tool_name = response["choices"][0]["text"][len("functions.") :-1]
tool = next(
(tool for tool in tools if tool["function"]["name"] == tool_name), None
)
Expand Down

0 comments on commit c9c7337

Please sign in to comment.