Update llama.py

This commit is contained in:
Daniel Han-Chen 2024-02-26 14:36:39 +11:00
commit 0d24acf0f5

View file

@ -283,10 +283,10 @@ def LlamaAttention_fast_forward(
if position_ids is None:
cos = self.rotary_emb.cos_cached
sin = self.rotary_emb.sin_cached
if cos is None:
# Need to call rotary_emb to init it
cos, sin = self.rotary_emb(V, position_ids, seq_len = kv_seq_len)
pass
# if cos is None:
# # Need to call rotary_emb to init it
# cos, sin = self.rotary_emb(V, position_ids, seq_len = kv_seq_len)
# pass
Q, K = fast_rope_embedding(Q, K, cos, sin)
else:
cos, sin = self.rotary_emb(V, seq_len = kv_seq_len)