Skip to content

Commit 2b2cf6d

Browse files
committed
small fixes
1 parent 6d80075 commit 2b2cf6d

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

convert_hf_to_gguf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3920,6 +3920,7 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
39203920
if name.startswith("distilbert."):
39213921
name = name[11:]
39223922

3923+
# These layers act as MLM head, so we don't need them
39233924
if name.startswith("vocab_"):
39243925
return []
39253926

src/llama-model.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2116,9 +2116,7 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
21162116
case LLM_ARCH_NOMIC_BERT_MOE:
21172117
{
21182118
tok_embd = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, 0);
2119-
if (arch != LLM_ARCH_DISTIL_BERT) {
2120-
type_embd = create_tensor(tn(LLM_TENSOR_TOKEN_TYPES, "weight"), {n_embd, n_token_types}, 0);
2121-
}
2119+
type_embd = create_tensor(tn(LLM_TENSOR_TOKEN_TYPES, "weight"), {n_embd, n_token_types}, TENSOR_NOT_REQUIRED);
21222120

21232121
if (arch == LLM_ARCH_BERT || arch == LLM_ARCH_DISTIL_BERT) {
21242122
pos_embd = create_tensor(tn(LLM_TENSOR_POS_EMBD, "weight"), {n_embd, n_ctx_train}, 0);

0 commit comments

Comments
 (0)