Skip to content

Commit

Permalink
fix: change type of bcs loss label
Browse files Browse the repository at this point in the history
  • Loading branch information
LongxingTan committed Apr 24, 2024
1 parent 4d6f44d commit 5369323
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/retrievals/models/rerank.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def forward(
logger.warning('loss_fn is not setup, use BCEWithLogitsLoss')
self.loss_fn = nn.BCEWithLogitsLoss(reduction='mean')

loss = self.loss_fn(logits, labels)
loss = self.loss_fn(logits, labels.float())
if return_dict:
outputs_dict['loss'] = loss
return outputs_dict
Expand Down

0 comments on commit 5369323

Please sign in to comment.