From 666afe362a3f78cce7640f3325673b55e9668b4e Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 12 Feb 2025 16:23:47 -0800 Subject: [PATCH] Update rl_replacements.py --- unsloth/models/rl_replacements.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py index 0063ea4af6..0f342ec86e 100644 --- a/unsloth/models/rl_replacements.py +++ b/unsloth/models/rl_replacements.py @@ -142,7 +142,7 @@ def grpo_trainer__move_model_to_vllm(function_name, function): if function_name != "_move_model_to_vllm": return function # .*? matches first match. .+? matches final match. - function = "def _move_model_to_vllm(self, *args, **kwargs): return None\n" - return function.find("def") * " " + function + replacement = "def _move_model_to_vllm(self, *args, **kwargs): return None\n" + return " "*function.find("def") + replacement pass RL_FUNCTIONS["grpo_trainer"].append(grpo_trainer__move_model_to_vllm)