Skip to content

Commit

Permalink
assign to a results variable regardless of whether logprobs are ena…
Browse files Browse the repository at this point in the history
…bled
  • Loading branch information
rishsriv committed Jun 24, 2024
1 parent 7012efd commit 49249fd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion eval/api_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,11 +282,12 @@ def run_api_eval(args):
if not os.path.exists(output_dir):
os.makedirs(output_dir)

results = output_df.to_dict("records")

if logprobs:
print(
f"Writing logprobs to JSON file at eval-visualizer/public/{output_file.split('/')[-1].replace('.csv', '.json')}"
)
results = output_df.to_dict("records")
with open(
f"./eval-visualizer/public/{output_file.split('/')[-1].replace('.csv', '.json')}",
"w",
Expand Down

0 comments on commit 49249fd

Please sign in to comment.