From 435f82d61a1eddb84854ca59a008a8e4d97ab439 Mon Sep 17 00:00:00 2001 From: liuzhenwei Date: Mon, 22 Jun 2026 16:40:43 +0800 Subject: [PATCH] [Bugfix] Fix Llama4ForCausalLM initialization test failure (#46341) Signed-off-by: zhenwei-intel --- tests/models/utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/models/utils.py b/tests/models/utils.py index 8a62955213..1c4b9c93b0 100644 --- a/tests/models/utils.py +++ b/tests/models/utils.py @@ -507,7 +507,13 @@ def dummy_hf_overrides( # Only set MoE related config when the model has MoE layers. # Otherwise all models detected as MoE by _get_transformers_backend_cls. if model_arch_config.num_experts > 0: - num_experts_per_tok = 1 if model_arch == "Llama4ForConditionalGeneration" else 2 + num_experts_per_tok = 2 + if model_arch in ( + "Llama4ForConditionalGeneration", + "Llama4ForCausalLM", + "EagleLlama4ForCausalLM", + ): + num_experts_per_tok = 1 update_dict.update( { "num_experts": num_experts,