11diff --git a/src/llama-arch.cpp b/src/llama-arch.cpp
2- index 435e3b9b..702c9ad9 100644
2+ index aa21108a..907cd4b8 100644
33--- a/src/llama-arch.cpp
44+++ b/src/llama-arch.cpp
55@@ -17,6 +17,7 @@ static const std::map<llm_arch, const char *> LLM_ARCH_NAMES = {
@@ -10,7 +10,7 @@ index 435e3b9b..702c9ad9 100644
1010 { LLM_ARCH_BERT, "bert" },
1111 { LLM_ARCH_NOMIC_BERT, "nomic-bert" },
1212 { LLM_ARCH_NOMIC_BERT_MOE, "nomic-bert-moe" },
13- @@ -465 ,6 +466 ,22 @@ static const std::map<llm_arch, std::map<llm_tensor, const char *>> LLM_TENSOR_N
13+ @@ -466 ,6 +467 ,22 @@ static const std::map<llm_arch, std::map<llm_tensor, const char *>> LLM_TENSOR_N
1414 { LLM_TENSOR_FFN_UP, "blk.%d.ffn_up" },
1515 },
1616 },
@@ -34,7 +34,7 @@ index 435e3b9b..702c9ad9 100644
3434 LLM_ARCH_BERT,
3535 {
3636diff --git a/src/llama-arch.h b/src/llama-arch.h
37- index 9181ad05..01671138 100644
37+ index 0771ec3e..18de556c 100644
3838--- a/src/llama-arch.h
3939+++ b/src/llama-arch.h
4040@@ -21,6 +21,7 @@ enum llm_arch {
@@ -46,10 +46,10 @@ index 9181ad05..01671138 100644
4646 LLM_ARCH_NOMIC_BERT,
4747 LLM_ARCH_NOMIC_BERT_MOE,
4848diff --git a/src/llama-model.cpp b/src/llama-model.cpp
49- index fc39195e..e76d37f2 100644
49+ index b15bf73c..20dea2bb 100644
5050--- a/src/llama-model.cpp
5151+++ b/src/llama-model.cpp
52- @@ -740 ,6 +740 ,16 @@ void llama_model::load_hparams(llama_model_loader & ml) {
52+ @@ -741 ,6 +741 ,16 @@ void llama_model::load_hparams(llama_model_loader & ml) {
5353 default: type = LLM_TYPE_UNKNOWN;
5454 }
5555 } break;
@@ -66,15 +66,15 @@ index fc39195e..e76d37f2 100644
6666 case LLM_ARCH_NOMIC_BERT:
6767 case LLM_ARCH_NOMIC_BERT_MOE:
6868 {
69- @@ -2183 ,6 +2193 ,7 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
69+ @@ -2192 ,6 +2202 ,7 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
7070 layer.ffn_up_b = create_tensor(tn(LLM_TENSOR_FFN_UP, "bias", i), {n_ff}, 0);
7171 }
7272 } break;
7373+ case LLM_ARCH_NEW:
7474 case LLM_ARCH_BERT:
7575 case LLM_ARCH_NOMIC_BERT:
7676 case LLM_ARCH_NOMIC_BERT_MOE:
77- @@ -2190 ,7 +2201 ,7 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
77+ @@ -2199 ,7 +2210 ,7 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
7878 tok_embd = create_tensor(tn(LLM_TENSOR_TOKEN_EMBD, "weight"), {n_embd, n_vocab}, 0);
7979 type_embd = create_tensor(tn(LLM_TENSOR_TOKEN_TYPES, "weight"), {n_embd, n_token_types}, TENSOR_NOT_REQUIRED);
8080
@@ -83,7 +83,7 @@ index fc39195e..e76d37f2 100644
8383 pos_embd = create_tensor(tn(LLM_TENSOR_POS_EMBD, "weight"), {n_embd, n_ctx_train}, 0);
8484
8585 cls = create_tensor(tn(LLM_TENSOR_CLS, "weight"), {n_embd, n_embd}, TENSOR_NOT_REQUIRED);
86- @@ -2231 ,12 +2242 ,16 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
86+ @@ -2240 ,12 +2251 ,16 @@ bool llama_model::load_tensors(llama_model_loader & ml) {
8787 layer.ffn_down_exps = create_tensor(tn(LLM_TENSOR_FFN_DOWN_EXPS, "weight", i), { n_ff, n_embd, n_expert}, 0);
8888 layer.ffn_gate_inp = create_tensor(tn(LLM_TENSOR_FFN_GATE_INP, "weight", i), {n_embd, n_expert}, 0);
8989 } else {
@@ -103,7 +103,7 @@ index fc39195e..e76d37f2 100644
103103 layer.ffn_down_b = create_tensor(tn(LLM_TENSOR_FFN_DOWN, "bias", i), {n_embd}, 0);
104104 } else {
105105 layer.ffn_gate = create_tensor(tn(LLM_TENSOR_FFN_GATE, "weight", i), {n_embd, n_ff}, 0);
106- @@ -6138 ,7 +6153 ,7 @@ struct llm_build_bert : public llm_graph_context {
106+ @@ -6181 ,7 +6196 ,7 @@ struct llm_build_bert : public llm_graph_context {
107107 ggml_tensor * type_row0 = ggml_view_1d(ctx0, model.type_embd, n_embd, 0);
108108 inpL = ggml_add(ctx0, inpL, type_row0);
109109 }
@@ -112,7 +112,7 @@ index fc39195e..e76d37f2 100644
112112 inpL = ggml_add(ctx0, ggml_get_rows(ctx0, model.pos_embd, inp_pos), inpL);
113113 }
114114 cb(inpL, "inp_embd", -1);
115- @@ -6197 ,7 +6212 ,7 @@ struct llm_build_bert : public llm_graph_context {
115+ @@ -6240 ,7 +6255 ,7 @@ struct llm_build_bert : public llm_graph_context {
116116 Vcur = ggml_reshape_3d(ctx0, Vcur, n_embd_head, n_head_kv, n_tokens);
117117
118118 // RoPE
@@ -121,7 +121,7 @@ index fc39195e..e76d37f2 100644
121121 Qcur = ggml_rope_ext(
122122 ctx0, Qcur, inp_pos, nullptr,
123123 n_rot, rope_type, n_ctx_orig, freq_base, freq_scale,
124- @@ -6256 ,6 +6271 ,13 @@ struct llm_build_bert : public llm_graph_context {
124+ @@ -6299 ,6 +6314 ,13 @@ struct llm_build_bert : public llm_graph_context {
125125 0.0f,
126126 LLAMA_EXPERT_GATING_FUNC_TYPE_SOFTMAX, il);
127127 cb(cur, "ffn_moe_out", il);
@@ -135,23 +135,23 @@ index fc39195e..e76d37f2 100644
135135 } else if (model.arch == LLM_ARCH_BERT || model.arch == LLM_ARCH_NOMIC_BERT_MOE) {
136136 cur = build_ffn(cur,
137137 model.layers[il].ffn_up, model.layers[il].ffn_up_b, NULL,
138- @@ -14266 ,6 +14288 ,7 @@ llama_memory_i * llama_model::create_memory(const llama_memory_params & params,
138+ @@ -14439 ,6 +14461 ,7 @@ llama_memory_i * llama_model::create_memory(const llama_memory_params & params,
139139 switch (arch) {
140140 // Models that need specific instantiation should be handled in the
141141 // switch statement
142142+ case LLM_ARCH_NEW:
143143 case LLM_ARCH_BERT:
144144 case LLM_ARCH_JINA_BERT_V2:
145145 case LLM_ARCH_NOMIC_BERT:
146- @@ -14390 ,6 +14413 ,7 @@ llm_graph_result_ptr llama_model::build_graph(
146+ @@ -14563 ,6 +14586 ,7 @@ llm_graph_result_ptr llama_model::build_graph(
147147 {
148148 llm = std::make_unique<llm_build_refact>(*this, params, gf);
149149 } break;
150150+ case LLM_ARCH_NEW:
151151 case LLM_ARCH_BERT:
152152 case LLM_ARCH_JINA_BERT_V2:
153153 case LLM_ARCH_NOMIC_BERT:
154- @@ -14792 ,6 +14816 ,7 @@ llama_rope_type llama_model_rope_type(const llama_model * model) {
154+ @@ -14970 ,6 +14994 ,7 @@ llama_rope_type llama_model_rope_type(const llama_model * model) {
155155 case LLM_ARCH_FALCON:
156156 case LLM_ARCH_GROK:
157157 case LLM_ARCH_DBRX:
0 commit comments