Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbenayoun committed Oct 28, 2024
1 parent e219421 commit c9ccd7f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions optimum/neuron/trainers.py
Original file line number Diff line number Diff line change
Expand Up @@ -2238,6 +2238,7 @@ def odds_ratio_loss(
# torch.log1p(-torch.exp(policy_chosen_logps)) - torch.log1p(-torch.exp(policy_rejected_logps))
# )

# We used this instead of `torch.log1p` because it produces NaNs in BF16.
def log1p(x):
return torch.log(1 + x)

Expand Down

0 comments on commit c9ccd7f

Please sign in to comment.