fix mixed mm inputs and rlhf-v

This commit is contained in:
hiyouga
2024-09-01 20:52:47 +08:00
parent b5063b4144
commit 9967ccb3ae
20 changed files with 306 additions and 277 deletions

View File

@@ -138,3 +138,17 @@ class GLM4ToolUtils(ToolUtils):
return content
return [(tool_name, json.dumps(arguments, ensure_ascii=False))]
TOOLS = {
"default": DefaultToolUtils(),
"glm4": GLM4ToolUtils(),
}
def get_tool_utils(name: str) -> "ToolUtils":
tool_utils = TOOLS.get(name, None)
if tool_utils is None:
raise ValueError("Tool utils `{}` not found.".format(name))
return tool_utils