Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intial RPO loss #1686

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
clean up
  • Loading branch information
kashif committed Jun 2, 2024
commit cd6f5543cdc2f5ce668f8de26488b6c24d12aadb
5 changes: 0 additions & 5 deletions trl/trainer/dpo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1120,11 +1120,6 @@ def get_batch_logps(

return (per_token_logps * loss_mask).sum(-1), loss_mask.sum(-1)

# if average_log_prob:
# return (per_token_logps * loss_mask).sum(-1) / loss_mask.sum(-1)
# else:
# return (per_token_logps * loss_mask).sum(-1)

def concatenated_forward(
self, model: nn.Module, batch: Dict[str, Union[List, torch.LongTensor]]
) -> Tuple[torch.FloatTensor, torch.FloatTensor, torch.FloatTensor, torch.FloatTensor]:
Expand Down
Loading