From d28ff5d5a1ad63a366da6a11d2d0e1b93b2aceb0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 05:33:48 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- unsloth/models/rl.py | 3 +-- unsloth/models/rl_replacements.py | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index 0b5283aa41..005d3b3c9d 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -32,7 +32,7 @@ from .rl_replacements import ( RL_PRE_ITEMS, RL_CONFIG_CHANGES, RL_METRICS_CHANGES, - RL_ADDITIONAL_FUNCTIONS + RL_ADDITIONAL_FUNCTIONS, ) torch_compile_options = { @@ -1329,7 +1329,6 @@ def patch_trl_rl_trainers(): def patch_trl_openenv(): - for function in RL_ADDITIONAL_FUNCTIONS["openenv"]: print(f"Unsloth: Patching trl openenv with function: {function.__name__}") function() # Call the function to apply the patch diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py index 0665b30bd7..661abd09de 100644 --- a/unsloth/models/rl_replacements.py +++ b/unsloth/models/rl_replacements.py @@ -957,7 +957,7 @@ def openenv_vllm_reload_weights(): # Change wake_up(tags=["kv_cache"]) to wake_up() - wake everything to set is_sleeping=False # This prevents double wake_up issues. Unsloth's allocator skips weights anyway. - src = re.sub(r'\.wake_up\(tags=\[.*?\]\)', '.wake_up()', src) + src = re.sub(r"\.wake_up\(tags=\[.*?\]\)", ".wake_up()", src) if original_src == src: print("Unsloth: Warning - regex did not match, patch may have failed")