From 2a6bc2ad101f423548acc2dda23335460128cc6f Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 26 Dec 2024 18:19:45 -0800 Subject: [PATCH] Update _utils.py --- unsloth/models/_utils.py | 1 + 1 file changed, 1 insertion(+) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 1a8b20365d..c9ca3eb1e5 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -1126,6 +1126,7 @@ def patch_gradient_accumulation_fix(Trainer): r"(.+?)return loss\.detach\(\) \/ self\.args\.gradient_accumulation_steps", "else:\n"\ + "\1print(self.args.gradient_accumulation_steps)\n" "\2if num_items_in_batch is None:\n"\ "\3loss = loss / self.args.gradient_accumulation_steps\n"\ "\1self.accelerator.backward(loss, **kwargs)",