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>
This commit is contained in:
Harry Mellor 2025-11-13 16:02:42 +00:00 committed by GitHub
parent 3035d1a166
commit b230286fbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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