From 7c14205ba87b1b35017c09b2d708deb905659888 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 13 Feb 2025 01:44:00 -0800 Subject: [PATCH] Update rl_replacements.py --- unsloth/models/rl_replacements.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unsloth/models/rl_replacements.py b/unsloth/models/rl_replacements.py index 0df37e5084..a56a7840cc 100644 --- a/unsloth/models/rl_replacements.py +++ b/unsloth/models/rl_replacements.py @@ -169,7 +169,7 @@ def grpo_trainer__get_per_token_logps(function_name, function): if len(original) != 0: original = original[0] replacer = \ - " "*4 + "with torch.amp.autocast(device_type = 'cuda', "\ + "with torch.amp.autocast(device_type = 'cuda', "\ "dtype = torch.float16 if os.environ.get('ACCELERATE_MIXED_PRECISION', 'fp16') == 'fp16' else torch.bfloat16) "\ "if not torch.is_autocast_enabled('cuda') else nullcontext():\n" + \ " "*8 + original