Update gemma.py
This commit is contained in:
parent
884fadc744
commit
147d129772
1 changed files with 2 additions and 2 deletions
|
|
@ -110,8 +110,8 @@ class FastGemmaRotaryEmbedding(torch.nn.Module):
|
|||
emb = torch.cat((freqs, freqs), dim=-1)
|
||||
|
||||
seq_len = position_ids.shape[1]
|
||||
new_cos = emb.cos().to(dtype=x.dtype)[:,:seq_len]
|
||||
new_sin = emb.sin().to(dtype=x.dtype)[:,:seq_len]
|
||||
new_cos = emb.cos().to(dtype=x.dtype)[:,:length]
|
||||
new_sin = emb.sin().to(dtype=x.dtype)[:,:length]
|
||||
|
||||
print(new_cos, new_cos.shape)
|
||||
print(old_cos, old_cos.shape)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue