Skip to content

Commit

Permalink
[data] fix qwen tool template (#6796)
Browse files Browse the repository at this point in the history
* Update tool_utils.py

* fix unittest

---------

Co-authored-by: hoshi-hiyouga <[email protected]>
  • Loading branch information
yueqis and hiyouga authored Feb 4, 2025
1 parent ab9bd06 commit dd6b7d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/llamafactory/data/tool_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class FunctionCall(NamedTuple):
"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>"""
)


Expand Down
2 changes: 1 addition & 1 deletion tests/data/test_formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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>"""
]


Expand Down

0 comments on commit dd6b7d2

Please sign in to comment.