Adding modeling.py file
Browse files- modeling.py +1 -1
modeling.py
CHANGED
|
@@ -109,7 +109,7 @@ class MoLM(PreTrainedModel):
|
|
| 109 |
# Expand the expert_mask to match the logits shape (batch_size, 1, 1)
|
| 110 |
expert_mask_expanded = expert_mask.unsqueeze(-1).unsqueeze(-1).float()
|
| 111 |
|
| 112 |
-
expert_output = expert(input_ids, targets=targets, date=date, **kwargs)
|
| 113 |
|
| 114 |
logits = expert_output["logits"]
|
| 115 |
loss_to_log = expert_output["loss_to_log"]
|
|
|
|
| 109 |
# Expand the expert_mask to match the logits shape (batch_size, 1, 1)
|
| 110 |
expert_mask_expanded = expert_mask.unsqueeze(-1).unsqueeze(-1).float()
|
| 111 |
|
| 112 |
+
expert_output = expert(input_ids, targets=targets, date=date, **kwargs, get_logits=True)
|
| 113 |
|
| 114 |
logits = expert_output["logits"]
|
| 115 |
loss_to_log = expert_output["loss_to_log"]
|