From: Khashayar Ghafouri Date: Thu, 16 Jul 2026 13:24:47 +0000 (+0530) Subject: conversion: accept BitNetForCausalLM architecture name (#25769) X-Git-Tag: upstream/0.0.10438~389 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=3278e921b1e66f0b21f83cc993a1c66019f38b68;p=pkg%2Fggml%2Fsources%2Fllama.cpp 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 --- diff --git a/conversion/__init__.py b/conversion/__init__.py index 02102fac8..465c010f6 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 a66446abe..0c2baee87 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