Skip to content

Commit 5da3811

Browse files
committed
feat: support GLM 4.5 family of models
1 parent 76e88c9 commit 5da3811

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/llama-model.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,7 +1429,10 @@ void llama_model::load_hparams(llama_model_loader & ml) {
14291429
ml.get_key(LLM_KV_FIRST_K_DENSE_REPLACE, hparams.first_k_dense_replace, 0);
14301430

14311431
// Expert gating function (GLM45 uses sigmoid)
1432-
ml.get_key(LLM_KV_EXPERT_GATING_FUNC, hparams.expert_gating_func, uint32_t(LLAMA_EXPERT_GATING_FUNC_TYPE_SIGMOID));
1432+
ml.get_key(LLM_KV_EXPERT_GATING_FUNC, hparams.expert_gating_func, false);
1433+
if (hparams.expert_gating_func == LLAMA_EXPERT_GATING_FUNC_TYPE_NONE) {
1434+
hparams.expert_gating_func = LLAMA_EXPERT_GATING_FUNC_TYPE_SIGMOID;
1435+
}
14331436

14341437
switch (hparams.n_layer) {
14351438
case 46: type = LLM_TYPE_12B; break; // GLM-4.5-Air

0 commit comments

Comments
 (0)