Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hebiao064 committed Dec 13, 2024
1 parent d3f565b commit ab08ab6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/liger_kernel/chunked_loss/kto_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ def preference_loss_fn(
chosen_rewards = beta * chosen_logratios.detach()
rejected_rewards = beta * rejected_logratios.detach()

return losses.sum() / (full_target.shape[0] // 2), chosen_rewards, rejected_rewards
return (
losses.sum() / (full_target.shape[0] // 2),
chosen_rewards,
rejected_rewards,
)

@staticmethod
def forward(
Expand Down

0 comments on commit ab08ab6

Please sign in to comment.