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.

[pre-commit.ci] auto fixes from pre-commit.com hooks

pre-commit-ci[bot]d8c9e6aafb6d
diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py
index bcac699b3f7..5158019132f 100644
--- a/unsloth/models/rl_replacements.py
+++ b/unsloth/models/rl_replacements.py
@@ -388,8 +388,8 @@ def grpo_trainer__generate_and_score_completions(function_name, function):
patched = patched[: match.start()] + wrapped + patched[match.end() :]
function = patched
-
- match = re.search(r'^(\s*)return output', function, re.MULTILINE)
+
+ match = re.search(r"^(\s*)return output", function, re.MULTILINE)
if match:
indent = match.group(1)
@@ -397,7 +397,7 @@ def grpo_trainer__generate_and_score_completions(function_name, function):
f"{indent}return output",
f"""{indent}if not _was_training:
{indent} self.model.for_inference()
- {indent}return output"""
+ {indent}return output""",
)
return function