Unverified Commit b230286f authored by Harry Mellor's avatar Harry Mellor Committed by GitHub
Browse files

Fix `get_num_experts` when config sets it explicitly to `None` (#28652)


Signed-off-by: default avatarHarry Mellor <19981378+hmellor@users.noreply.github.com>
Co-authored-by: default avatarbruceszchen <bruceszchen@tencent.com>
parent 3035d1a1
...@@ -1342,7 +1342,8 @@ class ModelConfig: ...@@ -1342,7 +1342,8 @@ class ModelConfig:
# Ernie VL's remote code uses list[int]... # Ernie VL's remote code uses list[int]...
# The values are always the same so we just take the first one. # The values are always the same so we just take the first one.
return num_experts[0] 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( def get_layers_start_end_indices(
self, parallel_config: ParallelConfig self, parallel_config: ParallelConfig
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment