From d7e0f8442e4e571509128d2a456ebdba5d04ca9f Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 13 Feb 2025 02:04:11 -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 048db868a8..81ca2debce 100644 --- a/unsloth/models/rl_replacements.py +++ b/unsloth/models/rl_replacements.py @@ -172,7 +172,7 @@ def grpo_trainer__get_per_token_logps(function_name, function): replacer = \ "if not hasattr(self, '_autocast_dtype'):\n" + \ " "*spaces + "self._autocast_dtype = torch.float16 if os.environ.get('ACCELERATE_MIXED_PRECISION', 'fp16') == 'fp16' else torch.bfloat16\n" + \ - "with torch.amp.autocast(device_type = 'cuda', dtype = self._autocast_dtype):\n" + \ + " "*spaces + "with torch.amp.autocast(device_type = 'cuda', dtype = self._autocast_dtype):\n" + \ " "*spaces + original function = function.replace(original, replacer) pass