From ccc9a895a6d805b899ec56ed51c2204dc3e394a9 Mon Sep 17 00:00:00 2001 From: hiyouga <467089858@qq.com> Date: Sat, 22 Jun 2024 00:00:38 +0800 Subject: [PATCH] fix api Former-commit-id: 3ce44dda991e9cf6cbce1fbe22ef1927893b6c4d --- src/llamafactory/api/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llamafactory/api/chat.py b/src/llamafactory/api/chat.py index 2c7e11e2..72b2ae50 100644 --- a/src/llamafactory/api/chat.py +++ b/src/llamafactory/api/chat.py @@ -93,7 +93,7 @@ def _process_request( if message.role == Role.ASSISTANT and isinstance(message.tool_calls, list) and len(message.tool_calls): tool_calls = [ - {"name": tool_call.function.name, "argument": tool_call.function.arguments} + {"name": tool_call.function.name, "arguments": tool_call.function.arguments} for tool_call in message.tool_calls ] content = json.dumps(tool_calls, ensure_ascii=False)