From a94cece8f6cec302f1f0fe6e4804d0e3085e224e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 21 Apr 2026 06:19:54 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/benchmarks/unsloth_grpo_common.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/scripts/benchmarks/unsloth_grpo_common.py b/scripts/benchmarks/unsloth_grpo_common.py index a015331c84..b01c3971d0 100644 --- a/scripts/benchmarks/unsloth_grpo_common.py +++ b/scripts/benchmarks/unsloth_grpo_common.py @@ -322,7 +322,9 @@ def write_stats( json.dump(stats, f, indent = 2) -def maybe_compile_trainer_forwards(trainer, compile_mode, *, dynamic: bool = True, tag: str = ""): +def maybe_compile_trainer_forwards( + trainer, compile_mode, *, dynamic: bool = True, tag: str = "" +): """torch.compile wrap `trainer.model.forward` and (if present) `trainer.ref_model.forward`. No-op if `compile_mode` is falsy. @@ -339,7 +341,9 @@ def maybe_compile_trainer_forwards(trainer, compile_mode, *, dynamic: bool = Tru except AttributeError: pass prefix = f"[{tag}] " if tag else "" - print(f"{prefix}Compiling trainer.model.forward (mode={compile_mode}, dynamic={dynamic})") + print( + f"{prefix}Compiling trainer.model.forward (mode={compile_mode}, dynamic={dynamic})" + ) trainer.model.forward = torch.compile( trainer.model.forward, mode = compile_mode,