miceworks commited on
Commit
eb8eb97
·
verified ·
1 Parent(s): 0cd0552

Sync MarkV3 HF AutoModel loader for 12h trained weights (modeling_mark_v3.py)

Browse files
Files changed (1) hide show
  1. modeling_mark_v3.py +1 -1
modeling_mark_v3.py CHANGED
@@ -48,7 +48,7 @@ def apply_rotary_pos_emb(x: torch.Tensor, cos: torch.Tensor, sin: torch.Tensor)
48
  seqlen = x.shape[2]
49
  cos = cos[:seqlen].unsqueeze(0).unsqueeze(1)
50
  sin = sin[:seqlen].unsqueeze(0).unsqueeze(1)
51
- return (x * cos) + (rotate_half(x) * sin)
52
 
53
  class MarkV3MLA(nn.Module):
54
  def __init__(self, config: MarkV3Config, layer_idx: int):
 
48
  seqlen = x.shape[2]
49
  cos = cos[:seqlen].unsqueeze(0).unsqueeze(1)
50
  sin = sin[:seqlen].unsqueeze(0).unsqueeze(1)
51
+ return ((x * cos) + (rotate_half(x) * sin)).to(x.dtype)
52
 
53
  class MarkV3MLA(nn.Module):
54
  def __init__(self, config: MarkV3Config, layer_idx: int):