From 637d01643ce321a62d616be012fc65e2076141b8 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Mon, 26 Feb 2024 14:37:48 +1100 Subject: [PATCH] Update llama.py --- unsloth/models/llama.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 25e2f84f71..316dae30df 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1173,8 +1173,9 @@ class 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