klemenk commited on
Commit
d2f818b
·
verified ·
1 Parent(s): f32a41a

Update modeling_auristream.py

Browse files
Files changed (1) hide show
  1. modeling_auristream.py +2 -2
modeling_auristream.py CHANGED
@@ -552,8 +552,8 @@ class CausalSelfAttention(nn.Module):
552
 
553
  if self.rotary is not None:
554
  cos, sin = self.rotary(q)
555
- q = apply_rotary_emb(q.transpose(1, 2), cos, sin).transpose(1, 2)
556
- k = apply_rotary_emb(k.transpose(1, 2), cos, sin).transpose(1, 2)
557
 
558
  # manual implementation of attention
559
  att = (q @ k.transpose(-2, -1)) * (1.0 / math.sqrt(k.size(-1)))
 
552
 
553
  if self.rotary is not None:
554
  cos, sin = self.rotary(q)
555
+ q = apply_rotary_emb(q, cos, sin)
556
+ k = apply_rotary_emb(k, cos, sin)
557
 
558
  # manual implementation of attention
559
  att = (q @ k.transpose(-2, -1)) * (1.0 / math.sqrt(k.size(-1)))