Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Update rl_replacements.py

Daniel Han0cf0a33c41a7
diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py
index dd4d5a0e8f4..06ae82140b5 100644
--- a/unsloth/models/rl_replacements.py
+++ b/unsloth/models/rl_replacements.py
@@ -164,11 +164,11 @@ 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
+
+ def _move_model_to_vllm(self, *args, **kwargs): return None
- print(function)
- # .*? matches first match. .+? matches final match.
- replacement = "def _move_model_to_vllm(self, *args, **kwargs): return None\n"
- return " "*function.find("def") + replacement
+ function = inspect.getsource(_move_model_to_vllm)
+ return function
pass
RL_FUNCTIONS["grpo_trainer"].append(grpo_trainer__move_model_to_vllm)