Update modeling_ddllama.py
Browse files- modeling_ddllama.py +0 -4
modeling_ddllama.py
CHANGED
@@ -1225,10 +1225,6 @@ class DDLlamaForCausalLM(DDLlamaPreTrainedModel, GenerationMixin):
|
|
1225 |
router_masks = [mask.to(hidden_states.device) for mask in router_masks]
|
1226 |
router_masks = torch.stack(router_masks, dim=-1).float()
|
1227 |
|
1228 |
-
n_layers = torch.sum(router_masks, dim=1).squeeze(dim=0)
|
1229 |
-
n_layers_list = n_layers.cpu().tolist()
|
1230 |
-
print(n_layers_list, end='')
|
1231 |
-
|
1232 |
if self.training and labels is not None:
|
1233 |
router_weights *= router_masks
|
1234 |
shift_router_weights = router_weights[:, :-1, :].contiguous()
|
|
|
1225 |
router_masks = [mask.to(hidden_states.device) for mask in router_masks]
|
1226 |
router_masks = torch.stack(router_masks, dim=-1).float()
|
1227 |
|
|
|
|
|
|
|
|
|
1228 |
if self.training and labels is not None:
|
1229 |
router_weights *= router_masks
|
1230 |
shift_router_weights = router_weights[:, :-1, :].contiguous()
|