From add6fa837fb3bbe8b626b0dd66a74dd4e55ffb56 Mon Sep 17 00:00:00 2001 From: Zhang Peiyuan Date: Wed, 27 Sep 2023 21:36:44 +0800 Subject: [PATCH] remove bug in convert.py permute function --- convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert.py b/convert.py index 4ac5030db61eb..8bb6c7e410852 100755 --- a/convert.py +++ b/convert.py @@ -439,7 +439,7 @@ def __repr__(self) -> str: def permute(weights: NDArray, n_head: int, n_head_kv: int) -> NDArray: #print( "permute debug " + str(weights.shape[0]) + " x " + str(weights.shape[1]) + " nhead " + str(n_head) + " nheadkv " + str(n_kv_head) ) if n_head_kv is not None and n_head != n_head_kv: - n_head //= n_head_kv + n_head = n_head_kv return (weights.reshape(n_head, 2, weights.shape[0] // n_head // 2, *weights.shape[1:]) .swapaxes(1, 2) .reshape(weights.shape))