From a01668bbe8c59a8251be2e05f397aa15d2c7461b Mon Sep 17 00:00:00 2001 From: hoshi-hiyouga Date: Thu, 19 Sep 2024 16:21:21 +0800 Subject: [PATCH] fix bug Former-commit-id: b6d0ee1fd8b555bc6aac8b8686c9a3eea784c3a8 --- src/llamafactory/data/formatter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llamafactory/data/formatter.py b/src/llamafactory/data/formatter.py index 6fe571b9..8a016685 100644 --- a/src/llamafactory/data/formatter.py +++ b/src/llamafactory/data/formatter.py @@ -113,7 +113,7 @@ class FunctionFormatter(Formatter): functions.append((tool_call["name"], json.dumps(tool_call["arguments"], ensure_ascii=False))) except json.JSONDecodeError: - raise RuntimeError("Invalid JSON format in function message: {}".format(content) + raise RuntimeError("Invalid JSON format in function message: {}".format(content)) elements = [] for name, arguments in functions: @@ -141,7 +141,7 @@ class ToolFormatter(Formatter): tools = json.loads(content) return [self.tool_utils.tool_formatter(tools) if len(tools) != 0 else ""] except json.JSONDecodeError: - raise RuntimeError("Invalid JSON format in tool description: {}".format(content) + raise RuntimeError("Invalid JSON format in tool description: {}".format(content)) @override