From 20e9ca2fac88a6f24ac02ff1cf08e87d16e9a4b5 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Sun, 25 Feb 2024 03:16:55 +1100 Subject: [PATCH] Update gemma.py --- unsloth/models/gemma.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsloth/models/gemma.py b/unsloth/models/gemma.py index 282ecb3e54..2c0606a181 100644 --- a/unsloth/models/gemma.py +++ b/unsloth/models/gemma.py @@ -154,10 +154,10 @@ def GemmaAttention_fast_forward( if True:#position_ids is None: # cos = self.rotary_emb.cos_cached # sin = self.rotary_emb.sin_cached - cos, sin = self.rotary_emb(V, position_ids, seq_len = q_len+1) + cos, sin = self.rotary_emb(V, position_ids, seq_len = q_len) Q, K = fast_rope_embedding(Q, K, cos, sin) else: - cos, sin = self.rotary_emb(V, position_ids, seq_len = q_len+1) + cos, sin = self.rotary_emb(V, position_ids, seq_len = q_len) Q, K = inplace_rope_embedding(Q, K, cos, sin, position_ids) pass