Skip to content

Commit b61fc91

Browse files
committed
feat: support GLM 4.5 family of models
1 parent 03fad04 commit b61fc91

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/llama-model.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1429,6 +1429,7 @@ void llama_model::load_hparams(llama_model_loader & ml) {
14291429
ml.get_key(LLM_KV_EXPERT_USED_COUNT, hparams.n_expert_used, 0);
14301430
ml.get_key(LLM_KV_EXPERT_SHARED_COUNT, hparams.n_expert_shared, 0);
14311431
ml.get_key(LLM_KV_LEADING_DENSE_BLOCK_COUNT, hparams.n_layer_dense_lead, 0);
1432+
ml.get_key(LLM_KV_EXPERT_WEIGHTS_SCALE, hparams.expert_weights_scale);
14321433

14331434
// Expert gating function (GLM4_MOE uses sigmoid)
14341435
ml.get_key(LLM_KV_EXPERT_GATING_FUNC, hparams.expert_gating_func, false);
@@ -13587,7 +13588,7 @@ struct llm_build_glm4_moe : public llm_graph_context {
1358713588
model.layers[il].ffn_exp_probs_b,
1358813589
n_expert, n_expert_used,
1358913590
LLM_FFN_SILU, true,
13590-
false, 0.0,
13591+
true, hparams.expert_weights_scale,
1359113592
(llama_expert_gating_func_type) hparams.expert_gating_func,
1359213593
il);
1359313594
cb(moe_out, "ffn_moe_out", il);

0 commit comments

Comments
 (0)