From 51aa56efb9f31e32861aaf15b9a2563f20bfeebd Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 27 Feb 2025 03:42:03 -0800 Subject: [PATCH] Update rl_replacements.py --- unsloth/models/rl_replacements.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py index f88e362beb..ec311a7a83 100644 --- a/unsloth/models/rl_replacements.py +++ b/unsloth/models/rl_replacements.py @@ -101,7 +101,7 @@ def sft_trainer_prepare_dataset(function_name, function): # .*? matches first match. .+? matches final match. replacer = re.findall( - r"def {function_name}\(.*?\).*?\:\n", + r"def " + function_name + r"\(.*?\).*?\:\n", function, flags = re.MULTILINE | re.DOTALL, )