Skip to content

Commit 633a58a

Browse files
committed
feat: support GLM 4.5 family of models
1 parent 7f026fb commit 633a58a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

convert_hf_to_gguf.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6582,6 +6582,12 @@ def modify_tensors(self, data_torch: Tensor, name: str, bid: int | None) -> Iter
65826582
class Glm4MoeModel(TextModel):
65836583
model_arch = gguf.MODEL_ARCH.GLM4_MOE
65846584

6585+
def __init__(self, *args, **kwargs):
6586+
super().__init__(*args, **kwargs)
6587+
# GLM4_MOE has num_hidden_layers + 1 actual layers (including NextN layer)
6588+
self.block_count = self.hparams["num_hidden_layers"] + 1
6589+
self.tensor_map = gguf.get_tensor_name_map(self.model_arch, self.block_count)
6590+
65856591
def set_vocab(self):
65866592
from transformers import AutoTokenizer
65876593

0 commit comments

Comments
 (0)