From cca9f3379998b7750049423666c2e1a5205ce2b1 Mon Sep 17 00:00:00 2001 From: ljvmiranda921 Date: Sun, 4 Aug 2024 15:51:31 -0700 Subject: [PATCH] Cast scores properly --- scripts/run_rewardbench.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/run_rewardbench.py b/scripts/run_rewardbench.py index 83e9c37..fd31a34 100644 --- a/scripts/run_rewardbench.py +++ b/scripts/run_rewardbench.py @@ -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 [