From f2fa26f50b7c6ee38a851463eedefea767b1fab5 Mon Sep 17 00:00:00 2001 From: Csaba Kecskemeti Date: Wed, 5 Aug 2026 14:40:31 -0700 Subject: [PATCH] convert : accept "ExaoneMoeForCausalLM" arch spelling LG AI Research renamed the architecture from ExaoneMoEForCausalLM to ExaoneMoeForCausalLM when exaone_moe was upstreamed into Transformers v5, and updated the configs of already-released models accordingly (K-EXAONE-236B-A23B config.json, commit f7db87a, "Update README.md and config.json for Transformers v5"). Freshly downloaded K-EXAONE-236B-A23B and K-EXAONE-2.0-750B-A37B checkpoints therefore fail conversion with ERROR:hf-to-gguf:Model ExaoneMoeForCausalLM is not supported even though the architecture is implemented. The spelling comes from the checkpoint's own config.json, so it is unaffected by the installed Transformers version. Register both spellings so that older local copies keep working, as is already done for e.g. BitNet. Note this fixes the architecture lookup only. K-EXAONE-236B-A23B converts correctly with this change alone; K-EXAONE-2.0-750B-A37B additionally needs support for its two leading dense layers (declared via mlp_layer_types rather than first_k_dense_replace), its per-layer sliding windows of 0/128/4096, and clamped SwiGLU on layers 62-77. Co-Authored-By: Claude Opus 5 --- conversion/__init__.py | 1 + conversion/exaone.py | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/conversion/__init__.py b/conversion/__init__.py index 06c2c50ad245..1f781a7903af 100644 --- a/conversion/__init__.py +++ b/conversion/__init__.py @@ -70,6 +70,7 @@ "Exaone4ForCausalLM": "exaone", "ExaoneForCausalLM": "exaone", "ExaoneMoEForCausalLM": "exaone", + "ExaoneMoeForCausalLM": "exaone", "FalconForCausalLM": "falcon", "FalconH1ForCausalLM": "falcon_h1", "FalconMambaForCausalLM": "mamba", diff --git a/conversion/exaone.py b/conversion/exaone.py index bc4fb3f1b171..1cd2244dbc3d 100644 --- a/conversion/exaone.py +++ b/conversion/exaone.py @@ -123,7 +123,9 @@ def generate_extra_tensors(self) -> Iterable[tuple[str, Tensor]]: yield (self.format_tensor_name(gguf.MODEL_TENSOR.ROPE_FREQS), torch.tensor(rope_factors, dtype=torch.float32)) -@ModelBase.register("ExaoneMoEForCausalLM") +# note: transformers >= 5.1 renamed the class to "ExaoneMoeForCausalLM" (lowercase 'e'), +# so accept both spellings - LG AI have updated the configs of already-released models +@ModelBase.register("ExaoneMoEForCausalLM", "ExaoneMoeForCausalLM") class ExaoneMoEModel(Exaone4Model): model_arch = gguf.MODEL_ARCH.EXAONE_MOE