Skip to content

Commit

Permalink
Cast scores properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ljvmiranda921 committed Aug 4, 2024
1 parent e2091ed commit cca9f33
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions scripts/run_rewardbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,9 @@ def main():
score_rejected_batch = [result["score"] for result in rewards_rejected]
# for classes that directly output scores (custom code)
else:
score_chosen_batch = rewards_chosen.cpu().numpy().tolist()
score_rejected_batch = rewards_rejected.cpu().numpy().tolist()
# Cast to float in case of bfloat16
score_chosen_batch = rewards_chosen.float().cpu().numpy().tolist()
score_rejected_batch = rewards_rejected.float().cpu().numpy().tolist()

# log results
[
Expand Down

0 comments on commit cca9f33

Please sign in to comment.