From 3278e921b1e66f0b21f83cc993a1c66019f38b68 Mon Sep 17 00:00:00 2001 From: Khashayar Ghafouri <43180261+khashayarghafouri@users.noreply.github.com> Date: Thu, 16 Jul 2026 18:54:47 +0530 Subject: [PATCH] conversion: accept BitNetForCausalLM architecture name (#25769) Microsoft BitNet Hugging Face configs use BitNetForCausalLM while the converter only registered BitnetForCausalLM, causing conversion to fail with "Model BitNetForCausalLM is not supported". Register both spellings in TEXT_MODEL_MAP and the Bitnet model class. Fixes ggml-org/llama.cpp#25629 --- conversion/__init__.py | 1 + conversion/bitnet.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/conversion/__init__.py b/conversion/__init__.py index 02102fac8d..465c010f66 100644 --- a/conversion/__init__.py +++ b/conversion/__init__.py @@ -31,6 +31,7 @@ TEXT_MODEL_MAP: dict[str, str] = { "BertForSequenceClassification": "bert", "BertModel": "bert", "BitnetForCausalLM": "bitnet", + "BitNetForCausalLM": "bitnet", "BloomForCausalLM": "bloom", "BloomModel": "bloom", "CamembertModel": "bert", diff --git a/conversion/bitnet.py b/conversion/bitnet.py index a66446abee..0c2baee876 100644 --- a/conversion/bitnet.py +++ b/conversion/bitnet.py @@ -8,7 +8,7 @@ if TYPE_CHECKING: from .base import ModelBase, TextModel, gguf -@ModelBase.register("BitnetForCausalLM") +@ModelBase.register("BitnetForCausalLM", "BitNetForCausalLM") class BitnetModel(TextModel): model_arch = gguf.MODEL_ARCH.BITNET