From 0817c24c04ff89dc12691fd617867fc964222338 Mon Sep 17 00:00:00 2001 From: Yueqi Song <141804823+yueqis@users.noreply.github.com> Date: Wed, 5 Feb 2025 00:02:00 +0800 Subject: [PATCH] [data] fix qwen tool template (#6796) * Update tool_utils.py * fix unittest --------- Co-authored-by: hoshi-hiyouga Former-commit-id: 02bb78a792112f5151b3a96ddde2528823855288 --- src/llamafactory/data/tool_utils.py | 2 +- tests/data/test_formatter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/llamafactory/data/tool_utils.py b/src/llamafactory/data/tool_utils.py index a92701ed..44cf86cc 100644 --- a/src/llamafactory/data/tool_utils.py +++ b/src/llamafactory/data/tool_utils.py @@ -56,7 +56,7 @@ QWEN_TOOL_PROMPT = ( "You are provided with function signatures within XML tags:\n{tool_text}" "\n\n\nFor each function call, return a json object with function name and arguments within " """ XML tags:\n\n{{"name": , """ - """"arguments": }}\n<|im_end|>\n""" + """"arguments": }}\n""" ) diff --git a/tests/data/test_formatter.py b/tests/data/test_formatter.py index a76e68a6..4eb2072b 100644 --- a/tests/data/test_formatter.py +++ b/tests/data/test_formatter.py @@ -224,7 +224,7 @@ def test_qwen_tool_formatter(): f"\n{json.dumps(wrapped_tool, ensure_ascii=False)}" "\n\n\nFor each function call, return a json object with function name and arguments within " """ XML tags:\n\n{"name": , """ - """"arguments": }\n<|im_end|>\n""" + """"arguments": }\n""" ]