Skip to content

Commit b230286

Browse files
hmellorcboss6
andauthored
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 <bruceszchen@tencent.com>
1 parent 3035d1a commit b230286

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vllm/config/model.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1342,7 +1342,8 @@ def get_num_experts(self) -> int:
13421342
# Ernie VL's remote code uses list[int]...
13431343
# The values are always the same so we just take the first one.
13441344
return num_experts[0]
1345-
return num_experts
1345+
# Coerce to 0 if explicitly set to None
1346+
return num_experts or 0
13461347

13471348
def get_layers_start_end_indices(
13481349
self, parallel_config: ParallelConfig

0 commit comments

Comments
 (0)