From 1e35ab6722134ae5af8fdffdc3f8cfc7854ee41c Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 12 Feb 2025 16:16:31 -0800 Subject: [PATCH] Update rl_replacements.py --- unsloth/models/rl_replacements.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py index 67027f0b4d..a101d35a04 100644 --- a/unsloth/models/rl_replacements.py +++ b/unsloth/models/rl_replacements.py @@ -135,3 +135,14 @@ def grpo_trainer__prepare_inputs(function_name, function): return function pass RL_FUNCTIONS["grpo_trainer"].append(grpo_trainer__prepare_inputs) + + +# Remove _move_model_to_vllm +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(*args, **kwargs): return None\n" + return function +pass +RL_FUNCTIONS["grpo_trainer"].append(grpo_trainer__move_model_to_vllm)