From 36e1bc35f034cdbb9592fd1a9e025263a0661b72 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 5 Mar 2025 01:00:01 -0800 Subject: [PATCH] Update rl_replacements.py --- unsloth/models/rl_replacements.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py index 584214e801..7d46ea21b6 100644 --- a/unsloth/models/rl_replacements.py +++ b/unsloth/models/rl_replacements.py @@ -89,7 +89,10 @@ def sft_trainer_prepare_dataset(function_name, function): ) if matched: # Use fast version! - return inspect.getsource(fast_sft_prepare_dataset) + function = inspect.getsource(fast_sft_prepare_dataset) + function = function.replace("def sft_prepare_dataset", "def _prepare_dataset") + return function + pass pass check_text = \