修改了由于minicpm的GQA结构带来的模型转换bug
This commit is contained in:
parent
023b8807e1
commit
47d821a08c
1 changed files with 1 additions and 1 deletions
|
@ -1605,7 +1605,7 @@ class MiniCPMModel(Model):
|
|||
|
||||
def _reverse_hf_permute(self, weights: Tensor, n_head: int, n_kv_head: int | None = None) -> Tensor:
|
||||
if n_kv_head is not None and n_head != n_kv_head:
|
||||
n_head //= n_kv_head
|
||||
n_head = n_kv_head
|
||||
|
||||
return (
|
||||
weights.reshape(n_head, 2, weights.shape[0] // n_head // 2, *weights.shape[1:])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue