From 33b4c332799ff7c6dc6598f0817c879d84d6721f Mon Sep 17 00:00:00 2001 From: ZhangChuanhui <57099533+zhangch-ss@users.noreply.github.com> Date: Fri, 7 Mar 2025 15:17:23 +0800 Subject: [PATCH] [data] fix function formatter (#7201) Co-authored-by: zhangchuanhui Former-commit-id: 194e3bddb25fa0bcc6d8349ce682b537a07a9a6a --- src/llamafactory/data/formatter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/llamafactory/data/formatter.py b/src/llamafactory/data/formatter.py index c68f0a52..754fc54b 100644 --- a/src/llamafactory/data/formatter.py +++ b/src/llamafactory/data/formatter.py @@ -121,7 +121,7 @@ class FunctionFormatter(StringFormatter): function_str = self.tool_utils.function_formatter(functions) if thought: - function_str = thought.group(1) + function_str + function_str = thought.group(0) + function_str return super().apply(content=function_str)