mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2025-01-30 13:53:03 +01:00
convert : pad vocab size to multiple of 64, not 8
This commit is contained in:
parent
48a7ef6ebc
commit
b8ff85efe0
@ -1763,9 +1763,7 @@ class NomicBertModel(BertModel):
|
|||||||
for name, data in super().get_tensors():
|
for name, data in super().get_tensors():
|
||||||
# Nomic Embed's token embeddings tensor is padded, but llama.cpp wants tensor sizes to match exactly.
|
# Nomic Embed's token embeddings tensor is padded, but llama.cpp wants tensor sizes to match exactly.
|
||||||
if name == 'embeddings.word_embeddings.weight' and data.shape[1] != self.vocab_size:
|
if name == 'embeddings.word_embeddings.weight' and data.shape[1] != self.vocab_size:
|
||||||
rounded_vocab_size = (self.vocab_size + 7) // 8 * 8
|
rounded_vocab_size = (self.vocab_size + 63) // 64 * 64
|
||||||
print(data.shape)
|
|
||||||
print(rounded_vocab_size, self.hparams["n_embd"])
|
|
||||||
assert data.shape == (rounded_vocab_size, self.hparams["n_embd"])
|
assert data.shape == (rounded_vocab_size, self.hparams["n_embd"])
|
||||||
data = data[:self.vocab_size, :]
|
data = data[:self.vocab_size, :]
|
||||||
yield name, data
|
yield name, data
|
||||||
|
Loading…
Reference in New Issue
Block a user