Commit cb7934c52 for llama.cpp

commit cb7934c52ca8710994b2ecc19775ebefcfdb8d01
Author: Tarek Dakhran <tarek@liquid.ai>
Date:   Sat Oct 3 08:44:45 2026 +0200

    model : Add LFM2.5-Encoder-350M and LFM2.5-Encoder-230M (#29862)

    Register `Lfm2BidirectionalForMaskedLM` architecture for LFM2.5-Encoder
    models.

diff --git a/conversion/__init__.py b/conversion/__init__.py
index 6d8ae9c1a..051ddf99d 100644
--- a/conversion/__init__.py
+++ b/conversion/__init__.py
@@ -155,6 +155,7 @@ TEXT_MODEL_MAP: dict[str, str] = {
     "LevModel": "lev",
     "NimbleModel": "lev",
     "Lfm25AudioTokenizer": "lfm2",
+    "Lfm2BidirectionalForMaskedLM": "lfm2",
     "Lfm2BidirectionalModel": "lfm2",
     "Lfm2ForCausalLM": "lfm2",
     "Lfm2Model": "lfm2",
diff --git a/conversion/lfm2.py b/conversion/lfm2.py
index 984f44480..e50bbdd0f 100644
--- a/conversion/lfm2.py
+++ b/conversion/lfm2.py
@@ -65,19 +65,21 @@ class LFM2Model(TextModel):
         yield from super().modify_tensors(data_torch, name, bid)


-@ModelBase.register("Lfm2Model", "Lfm2BidirectionalModel")
-@ModelBase.example("LiquidAI/LFM2.5-ColBERT-350M", "LiquidAI/LFM2.5-Embedding-350M")
+@ModelBase.register("Lfm2Model", "Lfm2BidirectionalModel", "Lfm2BidirectionalForMaskedLM")
+@ModelBase.example("LiquidAI/LFM2.5-ColBERT-350M", "LiquidAI/LFM2.5-Embedding-350M", "LiquidAI/LFM2.5-Encoder-350M", "LiquidAI/LFM2.5-Encoder-230M")
 class LFM2ColBertModel(LFM2Model):
     model_arch = gguf.MODEL_ARCH.LFM2
     dense_tensor_name = "dense_2"

     def set_gguf_parameters(self):
         super().set_gguf_parameters()
-        if self.hf_arch == "Lfm2BidirectionalModel":
+        if self.hf_arch in ("Lfm2BidirectionalModel", "Lfm2BidirectionalForMaskedLM"):
             self.gguf_writer.add_causal_attention(False)
         self._try_set_pooling_type()

     def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iterable[tuple[str, Tensor]]:
+        # masked LM checkpoints use "lfm2." prefix
+        name = name.removeprefix("lfm2.")
         if not name.startswith(self.dense_tensor_name):
             name = "model." + name