From 8cfe8a57e627a83ab28c18d8af0e1c4fc09189b8 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 14 Mar 2025 08:33:33 -0700 Subject: [PATCH] Precision issues --- unsloth/models/_utils.py | 2 +- unsloth/models/rl.py | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 4ebde13b8c..10ba3530da 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "2025.3.12" +__version__ = "2025.3.13" __all__ = [ "SUPPORTS_BFLOAT16", diff --git a/unsloth/models/rl.py b/unsloth/models/rl.py index e412c3a5a0..c450ef6df5 100644 --- a/unsloth/models/rl.py +++ b/unsloth/models/rl.py @@ -238,9 +238,8 @@ def _patch_trl_rl_trainers(trainer_file = "grpo_trainer"): "use_fp16 = getattr(args, 'fp16', False)\n"\ "force_float32 = False\n"\ "if os.environ.get('UNSLOTH_FORCE_FLOAT32', '0') == '1':\n"\ - " if use_bf16 or use_fp16:\n"\ - " print('Unsloth: Switching to float32 training since model cannot work with float16')\n"\ - " force_float32 = True\n"\ + " print('Unsloth: Switching to float32 training since model cannot work with float16')\n"\ + " force_float32 = True\n"\ "mixed_precision_dtype = os.environ.get('UNSLOTH_MIXED_PRECISION', 'float32')\n"\ "dtype = getattr(model.config, 'torch_dtype', None)\n"\ "if dtype is None: dtype = model.get_input_embeddings().dtype\n"\