From 747210ff0ae1929f963903cd45ab08cdba727612 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 5 Mar 2025 04:50:26 -0800 Subject: [PATCH] Update llama.py --- unsloth/models/llama.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 52b4dc2c9f..3dacf5cdd5 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -409,12 +409,12 @@ def LlamaAttention_fast_forward( else: cos, sin = rotary_emb(V, seq_len = kv_seq_len) - Q, K = ( - fast_rope_embedding(Q, K, cos, sin) - if position_ids is None - else inplace_rope_embedding(Q, K, cos, sin, position_ids) - ) - # Q, K = fast_rope_embedding(Q, K, cos, sin) + # Q, K = ( + # fast_rope_embedding(Q, K, cos, sin) + # if position_ids is None + # else inplace_rope_embedding(Q, K, cos, sin, position_ids) + # ) + Q, K = fast_rope_embedding(Q, K, cos, sin) if past_key_value is not None: K = torch.cat([past_key_value[0], K], dim = 2)