fix: 修复部分已知问题

This commit is contained in:
2026-03-30 21:42:00 +08:00
parent 3e33c14376
commit 0e7fc623b4
10 changed files with 254 additions and 43 deletions
+2 -1
View File
@@ -93,7 +93,7 @@ class RotaryEmbedding(nn.Module):
seq_len = x.size(1)
if self.max_len_cached < seq_len + start_pos:
self._set_rotary_buffer(seq_len)
self._set_rotary_buffer(seq_len + start_pos)
cos = self.cos_cached[start_pos : start_pos + seq_len]
sin = self.sin_cached[start_pos : start_pos + seq_len]
@@ -237,6 +237,7 @@ class MLA(nn.Module):
use_gated_attention: bool,
layer_id: int
):
super().__init__()
self.dim = dim
self.n_heads = n_heads
self.n_kv_heads = n_kv_heads