From cf16811ab92f26ae77acce8fc5b35a9280a749e6 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Mon, 26 Feb 2024 14:38:27 +1100 Subject: [PATCH] Update gemma.py --- unsloth/models/gemma.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unsloth/models/gemma.py b/unsloth/models/gemma.py index cf27bacf7f..1608f7497a 100644 --- a/unsloth/models/gemma.py +++ b/unsloth/models/gemma.py @@ -631,8 +631,9 @@ class FastGemmaModel(FastLlamaModel): # Downcast RoPE embedding to correct data type if (name.endswith("rotary_emb") or hasattr(module, "cos_cached")) \ and (module.cos_cached.dtype != expected_dtype): - module.cos_cached = module.cos_cached.to(expected_dtype) - module.sin_cached = module.sin_cached.to(expected_dtype) + + module.cos_cached = module.cos_cached.to(expected_dtype) + module.sin_cached = module.sin_cached.to(expected_dtype) pass pass pass