Omartificial-Intelligence-Space
commited on
Commit
•
233c78c
1
Parent(s):
f84a30a
update populate
Browse files- src/populate.py +12 -9
src/populate.py
CHANGED
@@ -8,17 +8,20 @@ from src.display.utils import AutoEvalColumn, EvalQueueColumn
|
|
8 |
from src.leaderboard.read_evals import get_raw_eval_results
|
9 |
|
10 |
|
11 |
-
def get_leaderboard_df(
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
df
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
df = df.sort_values(by=['average'], ascending=False)
|
18 |
-
df = df[cols].round(decimals=2)
|
19 |
|
20 |
-
# Filter out if any of the benchmarks have not been produced
|
21 |
-
df = df[has_no_nan_values(df, benchmark_cols)]
|
22 |
return df
|
23 |
|
24 |
|
|
|
8 |
from src.leaderboard.read_evals import get_raw_eval_results
|
9 |
|
10 |
|
11 |
+
def get_leaderboard_df(eval_results_path, eval_requests_path, cols, benchmark_cols):
|
12 |
+
# Load evaluation results into a DataFrame
|
13 |
+
df = load_evaluation_results(eval_results_path)
|
14 |
+
|
15 |
+
# Check if the DataFrame is empty
|
16 |
+
if df.empty:
|
17 |
+
print("No evaluation results found. The leaderboard is currently empty.")
|
18 |
+
# Create an empty DataFrame with the required columns
|
19 |
+
df = pd.DataFrame(columns=cols)
|
20 |
+
return df
|
21 |
+
|
22 |
+
# Proceed to sort the DataFrame by 'average' if it's not empty
|
23 |
df = df.sort_values(by=['average'], ascending=False)
|
|
|
24 |
|
|
|
|
|
25 |
return df
|
26 |
|
27 |
|