Update llama.py

This commit is contained in:
Daniel Han 2024-07-23 11:12:58 -07:00
commit 2bcfe7d564

View file

@ -1010,6 +1010,7 @@ class LlamaRotaryEmbedding(torch.nn.Module):
pass
def forward(self, x, position_ids=None, seq_len=None):
print(x, position_ids, seq_len)
# x: [bs, num_attention_heads, seq_len, head_size]
if seq_len > self.current_rope_size:
self._set_cos_sin_cache(seq_len=seq_len, device=x.device, dtype=x.dtype)