Skip to content

Commit

Permalink
fix length bias
Browse files Browse the repository at this point in the history
  • Loading branch information
YannDubs committed Dec 29, 2023
1 parent e48d8eb commit aeef68e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/alpaca_eval/analyze.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def get_length_biases(
try:
df = annotations.drop_duplicates(subset=self.keys).copy()
df["best_output"] = np.where(df["preference"] < 1.5, df.output_1, df.output_2)
df["worse_output"] = np.where(df["preference"] > 2, df.output_1, df.output_2)
df["worse_output"] = np.where(df["preference"] > 1.5, df.output_1, df.output_2)

# Step 1: Create new columns indicating the length of `best_output` and `worse_output`
df["best_output_length"] = df["best_output"].apply(len)
Expand Down

0 comments on commit aeef68e

Please sign in to comment.