[data] fix qwen tool template (#6796)

* Update tool_utils.py

* fix unittest

---------

Co-authored-by: hoshi-hiyouga <hiyouga@buaa.edu.cn>
Former-commit-id: dd6b7d203eedbf09458c64654e8d97fec85f08d7
This commit is contained in:
Yueqi Song 2025-02-05 00:02:00 +08:00 committed by GitHub
parent 85f22d01bf
commit 8504bde893
2 changed files with 2 additions and 2 deletions

View File

@ -56,7 +56,7 @@ QWEN_TOOL_PROMPT = (
"You are provided with function signatures within <tools></tools> XML tags:\n<tools>{tool_text}"
"\n</tools>\n\nFor each function call, return a json object with function name and arguments within "
"""<tool_call></tool_call> XML tags:\n<tool_call>\n{{"name": <function-name>, """
""""arguments": <args-json-object>}}\n</tool_call><|im_end|>\n"""
""""arguments": <args-json-object>}}\n</tool_call>"""
)

View File

@ -224,7 +224,7 @@ def test_qwen_tool_formatter():
f"\n{json.dumps(wrapped_tool, ensure_ascii=False)}"
"\n</tools>\n\nFor each function call, return a json object with function name and arguments within "
"""<tool_call></tool_call> XML tags:\n<tool_call>\n{"name": <function-name>, """
""""arguments": <args-json-object>}\n</tool_call><|im_end|>\n"""
""""arguments": <args-json-object>}\n</tool_call>"""
]