Upload model.py with huggingface_hub
Browse files
model.py
CHANGED
|
@@ -21,7 +21,7 @@ class RMSNorm(nn.Module):
|
|
| 21 |
|
| 22 |
def rope(x, pos):
|
| 23 |
d = x.shape[-1]
|
| 24 |
-
freq = 10000 ** (torch.arange(0, d, 2, device=x.device) / d)
|
| 25 |
angle = pos[:, None, :, None].float() * freq
|
| 26 |
a, b = x.float()[..., ::2], x.float()[..., 1::2]
|
| 27 |
c, s = angle.cos(), angle.sin()
|
|
|
|
| 21 |
|
| 22 |
def rope(x, pos):
|
| 23 |
d = x.shape[-1]
|
| 24 |
+
freq = 10000 ** (-torch.arange(0, d, 2, device=x.device) / d)
|
| 25 |
angle = pos[:, None, :, None].float() * freq
|
| 26 |
a, b = x.float()[..., ::2], x.float()[..., 1::2]
|
| 27 |
c, s = angle.cos(), angle.sin()
|