[fix] Fix divide by zero error for llama4. (#8683)
This commit is contained in:
committed by
GitHub
parent
32f2815451
commit
7ed8e51bc3
@@ -415,6 +415,8 @@ class Llama4DecoderLayer(nn.Module):
|
||||
)
|
||||
|
||||
def _is_moe_layer(self, layer_id: int) -> bool:
|
||||
if self.config.interleave_moe_layer_step == 0:
|
||||
return self.config.num_local_experts > 0
|
||||
return (layer_id + 1) % self.config.interleave_moe_layer_step == 0
|
||||
|
||||
def forward(
|
||||
|
||||
Reference in New Issue
Block a user