mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-08-23 22:32:54 +08:00
fix bug
Former-commit-id: 98b464d2dd4ca303d24ae2bb31989f4458b18146
This commit is contained in:
parent
545ca7db99
commit
89138b8ab8
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user