Skip to content

Commit

Permalink
Fix for metrics calculating at step 2 (microsoft#426)
Browse files Browse the repository at this point in the history
Co-authored-by: Zhewei Yao <zheweiy@berkeley.edu>
  • Loading branch information
s-isaev and yaozhewei authored Apr 28, 2023
1 parent 427ce63 commit 354fc7f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,8 @@ def evaluation_reward(model, eval_dataloader):
scores += outputs["chosen_mean_scores"].mean().float()
if step == 99: # For faster evaluation and debugging
break
acc = correct_predictions / total_predictions
scores = scores / (step + 1)
acc = correct_predictions / total_predictions
scores = scores / (step + 1)
try:
acc = get_all_reduce_mean(acc).item()
scores = get_all_reduce_mean(scores).item()
Expand Down

0 comments on commit 354fc7f

Please sign in to comment.