diff options
author | Zhang Peiyuan <a1286225768@gmail.com> | 2023-09-28 02:45:20 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-27 20:45:20 +0200 |
commit | e519621010cac02c6fec0f8f3b16cda0591042c0 (patch) | |
tree | bf403a765d8ce4e06abee9c576ded6c9d27fc243 | |
parent | ac43576124a75c2de6e333ac31a3444ff9eb9458 (diff) |
convert : remove bug in convert.py permute function (#3364)
-rwxr-xr-x | convert.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -439,7 +439,7 @@ Vocab: TypeAlias = 'BpeVocab | SentencePieceVocab' 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)) |