Skip to content

Commit 505339f

Browse files
committed
convert : pad vocab size to multiple of 64, not 8
1 parent 489a0e8 commit 505339f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

convert-hf-to-gguf.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,9 +1763,7 @@ def get_tensors(self):
17631763
for name, data in super().get_tensors():
17641764
# Nomic Embed's token embeddings tensor is padded, but llama.cpp wants tensor sizes to match exactly.
17651765
if name == 'embeddings.word_embeddings.weight' and data.shape[1] != self.vocab_size:
1766-
rounded_vocab_size = (self.vocab_size + 7) // 8 * 8
1767-
print(data.shape)
1768-
print(rounded_vocab_size, self.hparams["n_embd"])
1766+
rounded_vocab_size = (self.vocab_size + 63) // 64 * 64
17691767
assert data.shape == (rounded_vocab_size, self.hparams["n_embd"])
17701768
data = data[:self.vocab_size, :]
17711769
yield name, data

0 commit comments

Comments
 (0)