Skip to content

Commit

Permalink
Fix code formatting (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
ljvmiranda921 authored Feb 9, 2024
1 parent 3320617 commit a4a5f38
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions analysis/get_benchmark_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,13 @@ def get_average_over_herm(
new_df = df.copy()
for subset in subsets:
if subset == "refusals":
subset_cols = ["refusals-dangerous", "refusals-offensive", "donotanswer","xstest-should-refuse", "xstest-should-respond"]
subset_cols = [
"refusals-dangerous",
"refusals-offensive",
"donotanswer",
"xstest-should-refuse",
"xstest-should-respond",
]
else:
subset_cols = [col for col in new_df.columns if subset in col]
new_df[subset] = np.round(np.nanmean(new_df[subset_cols].values, axis=1), 2)
Expand All @@ -132,7 +138,7 @@ def get_average_over_herm(
# Replace 'average' column with new average
new_df["average"] = np.round(np.nanmean(new_df[subsets].values, axis=1), 2)
# Rename column "hep" to "hep (code)"
new_df = new_df.rename(columns={"hep": "hep (code)"})
new_df = new_df.rename(columns={"hep": "hep (code)"})
return new_df


Expand Down

0 comments on commit a4a5f38

Please sign in to comment.