Upload modeling_deepseek.py
Browse files- modeling_deepseek.py +2 -2
modeling_deepseek.py
CHANGED
@@ -530,8 +530,8 @@ class DeepseekV3MoE(nn.Module):
|
|
530 |
y = self.moe_infer(hidden_states, topk_idx, topk_weight).view(*orig_shape)
|
531 |
# if self.config.n_shared_experts is not None:
|
532 |
# y = y + self.shared_experts(identity)
|
533 |
-
|
534 |
-
|
535 |
@torch.no_grad()
|
536 |
def moe_infer(self, x, topk_ids, topk_weight):
|
537 |
cnts = topk_ids.new_zeros((topk_ids.shape[0], len(self.experts)))
|
|
|
530 |
y = self.moe_infer(hidden_states, topk_idx, topk_weight).view(*orig_shape)
|
531 |
# if self.config.n_shared_experts is not None:
|
532 |
# y = y + self.shared_experts(identity)
|
533 |
+
return y
|
534 |
+
return 0
|
535 |
@torch.no_grad()
|
536 |
def moe_infer(self, x, topk_ids, topk_weight):
|
537 |
cnts = topk_ids.new_zeros((topk_ids.shape[0], len(self.experts)))
|