]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
model : remove modern-bert iswa template (#18529)
authorSigbjørn Skjæret <redacted>
Thu, 1 Jan 2026 23:06:42 +0000 (00:06 +0100)
committerGitHub <redacted>
Thu, 1 Jan 2026 23:06:42 +0000 (00:06 +0100)
* remove modern-bert iswa template

* forgotten

src/llama-model.cpp
src/models/models.h
src/models/modern-bert.cpp

index c2cd44de448a7b7a78133902bae9d6d121b3e5aa..0450db6c9fa3026cca81291caf4c21f1de820ad8 100644 (file)
@@ -7457,7 +7457,7 @@ ggml_cgraph * llama_model::build_graph(const llm_graph_params & params) const {
             } break;
         case LLM_ARCH_MODERN_BERT:
             {
-                llm = std::make_unique<llm_build_modern_bert<true>>(*this, params);
+                llm = std::make_unique<llm_build_modern_bert>(*this, params);
             } break;
         case LLM_ARCH_NEO_BERT:
             {
index e2cd4e484f797b45b559a0ca435d737455820c21..e78a788d4bd0847ca6ea59f05a0ce2a5249ad52b 100644 (file)
@@ -332,7 +332,6 @@ struct llm_build_mistral3 : public llm_graph_context {
     llm_build_mistral3(const llama_model & model, const llm_graph_params & params);
 };
 
-template <bool iswa>
 struct llm_build_modern_bert : public llm_graph_context {
     llm_build_modern_bert(const llama_model & model, const llm_graph_params & params);
 };
index c7809bdedfa8ee4dd434f645b377b5f260577231..6df418ecda289ab16743017f1a7e2d782df79769 100644 (file)
@@ -1,7 +1,6 @@
 #include "models.h"
 
-template <bool iswa>
-llm_build_modern_bert<iswa>::llm_build_modern_bert(const llama_model & model, const llm_graph_params & params) : llm_graph_context(params) {
+llm_build_modern_bert::llm_build_modern_bert(const llama_model & model, const llm_graph_params & params) : llm_graph_context(params) {
     const int64_t n_embd_head = hparams.n_embd_head_v;
     const int64_t n_embd_gqa  = hparams.n_embd_v_gqa();
 
@@ -24,13 +23,7 @@ llm_build_modern_bert<iswa>::llm_build_modern_bert(const llama_model & model, co
     auto * inp_attn = build_attn_inp_no_cache();
 
     for (int il = 0; il < n_layer; ++il) {
-        float freq_base_l  = 0.0f;
-
-        if constexpr (iswa) {
-            freq_base_l = model.get_rope_freq_base(cparams, il);
-        } else {
-            freq_base_l = freq_base;
-        }
+        float freq_base_l = model.get_rope_freq_base(cparams, il);
 
         cur = inpL;
 
@@ -120,7 +113,3 @@ llm_build_modern_bert<iswa>::llm_build_modern_bert(const llama_model & model, co
     res->t_embd = cur;
     ggml_build_forward_expand(gf, cur);
 }
-
-// Explicit template instantiations
-template struct llm_build_modern_bert<false>;
-template struct llm_build_modern_bert<true>;