From b230286fbc0b6d192e176ead55000471fd4f1080 Mon Sep 17 00:00:00 2001 From: Harry Mellor <19981378+hmellor@users.noreply.github.com> Date: Thu, 13 Nov 2025 16:02:42 +0000 Subject: [PATCH] Fix `get_num_experts` when config sets it explicitly to `None` (#28652) Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com> Co-authored-by: bruceszchen --- vllm/config/model.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vllm/config/model.py b/vllm/config/model.py index c47b619118ff2..f4ed99689e5b4 100644 --- a/vllm/config/model.py +++ b/vllm/config/model.py @@ -1342,7 +1342,8 @@ class ModelConfig: # Ernie VL's remote code uses list[int]... # The values are always the same so we just take the first one. return num_experts[0] - return num_experts + # Coerce to 0 if explicitly set to None + return num_experts or 0 def get_layers_start_end_indices( self, parallel_config: ParallelConfig