mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-08-13 11:50:37 +08:00
merge deepspeed
This commit is contained in:
@@ -7,7 +7,7 @@ class CrossEntropyLoss(nn.CrossEntropyLoss):
|
||||
|
||||
def forward(self, input, target, mask=None):
|
||||
if mask is not None:
|
||||
mask = mask.view(-1)
|
||||
mask = mask.view(-1).bool()
|
||||
input = input.view(-1, input.size(-1))
|
||||
target = target.view(-1)
|
||||
input = input[mask]
|
||||
|
||||
Reference in New Issue
Block a user