abhinav-joshi
commited on
Commit
•
967b0ef
1
Parent(s):
943a9a1
add eval name
Browse files- app.py +15 -4
- src/display/utils.py +2 -1
- src/populate.py +3 -1
app.py
CHANGED
@@ -32,7 +32,9 @@ from src.submission.submit import add_new_eval
|
|
32 |
|
33 |
|
34 |
def restart_space():
|
35 |
-
|
|
|
|
|
36 |
|
37 |
|
38 |
try:
|
@@ -62,7 +64,9 @@ except Exception:
|
|
62 |
|
63 |
|
64 |
raw_data, original_df = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
|
|
65 |
leaderboard_df = original_df.copy()
|
|
|
66 |
|
67 |
(
|
68 |
finished_eval_queue_df,
|
@@ -82,8 +86,8 @@ def update_table(
|
|
82 |
query: str,
|
83 |
):
|
84 |
filtered_df = filter_models(hidden_df, type_query, size_query, precision_query, show_deleted)
|
85 |
-
|
86 |
-
df = select_columns(
|
87 |
return df
|
88 |
|
89 |
|
@@ -92,13 +96,20 @@ def search_table(df: pd.DataFrame, query: str) -> pd.DataFrame:
|
|
92 |
|
93 |
|
94 |
def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
|
|
|
95 |
always_here_cols = [
|
96 |
# AutoEvalColumn.model_type_symbol.name,
|
97 |
-
AutoEvalColumn.
|
|
|
98 |
]
|
|
|
|
|
|
|
|
|
99 |
# We use COLS to maintain sorting
|
100 |
filtered_df = df[always_here_cols + [c for c in COLS if c in df.columns and c in columns]]
|
101 |
# filtered_df = df[[c for c in COLS if c in df.columns and c in columns]]
|
|
|
102 |
return filtered_df
|
103 |
|
104 |
|
|
|
32 |
|
33 |
|
34 |
def restart_space():
|
35 |
+
# breakpoint()
|
36 |
+
# API.restart_space(repo_id=REPO_ID)
|
37 |
+
return
|
38 |
|
39 |
|
40 |
try:
|
|
|
64 |
|
65 |
|
66 |
raw_data, original_df = get_leaderboard_df(EVAL_RESULTS_PATH, EVAL_REQUESTS_PATH, COLS, BENCHMARK_COLS)
|
67 |
+
|
68 |
leaderboard_df = original_df.copy()
|
69 |
+
# breakpoint()
|
70 |
|
71 |
(
|
72 |
finished_eval_queue_df,
|
|
|
86 |
query: str,
|
87 |
):
|
88 |
filtered_df = filter_models(hidden_df, type_query, size_query, precision_query, show_deleted)
|
89 |
+
filtered_df = filter_queries(query, filtered_df)
|
90 |
+
df = select_columns(filtered_df, columns)
|
91 |
return df
|
92 |
|
93 |
|
|
|
96 |
|
97 |
|
98 |
def select_columns(df: pd.DataFrame, columns: list) -> pd.DataFrame:
|
99 |
+
# breakpoint()
|
100 |
always_here_cols = [
|
101 |
# AutoEvalColumn.model_type_symbol.name,
|
102 |
+
# AutoEvalColumn.model_name.name,
|
103 |
+
"eval_name"
|
104 |
]
|
105 |
+
print(
|
106 |
+
"---------------",
|
107 |
+
AutoEvalColumn.model_name.name,
|
108 |
+
)
|
109 |
# We use COLS to maintain sorting
|
110 |
filtered_df = df[always_here_cols + [c for c in COLS if c in df.columns and c in columns]]
|
111 |
# filtered_df = df[[c for c in COLS if c in df.columns and c in columns]]
|
112 |
+
# breakpoint()
|
113 |
return filtered_df
|
114 |
|
115 |
|
src/display/utils.py
CHANGED
@@ -26,9 +26,10 @@ class ColumnContent:
|
|
26 |
auto_eval_column_dict = []
|
27 |
# Init
|
28 |
# auto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])
|
29 |
-
auto_eval_column_dict.append(["team", ColumnContent, ColumnContent("Team", "markdown", True, never_hidden=True)])
|
30 |
# auto_eval_column_dict.append(["team_name", ColumnContent, ColumnContent("team_name", "str", True)])
|
31 |
# Scores
|
|
|
32 |
auto_eval_column_dict.append(["average", ColumnContent, ColumnContent("Average ⬆️", "number", True)])
|
33 |
for task in Tasks:
|
34 |
auto_eval_column_dict.append([task.name, ColumnContent, ColumnContent(task.value.col_name, "number", True)])
|
|
|
26 |
auto_eval_column_dict = []
|
27 |
# Init
|
28 |
# auto_eval_column_dict.append(["model_type_symbol", ColumnContent, ColumnContent("T", "str", True, never_hidden=True)])
|
29 |
+
# auto_eval_column_dict.append(["team", ColumnContent, ColumnContent("Team", "markdown", True, never_hidden=True)])
|
30 |
# auto_eval_column_dict.append(["team_name", ColumnContent, ColumnContent("team_name", "str", True)])
|
31 |
# Scores
|
32 |
+
auto_eval_column_dict.append(["eval_name", ColumnContent, ColumnContent("eval_name", "str", True)])
|
33 |
auto_eval_column_dict.append(["average", ColumnContent, ColumnContent("Average ⬆️", "number", True)])
|
34 |
for task in Tasks:
|
35 |
auto_eval_column_dict.append([task.name, ColumnContent, ColumnContent(task.value.col_name, "number", True)])
|
src/populate.py
CHANGED
@@ -14,11 +14,13 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
|
|
14 |
all_data_json = [v.to_dict() for v in raw_data]
|
15 |
|
16 |
df = pd.DataFrame.from_records(all_data_json)
|
|
|
17 |
df = df.sort_values(by=[AutoEvalColumn.average.name], 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 raw_data, df
|
23 |
|
24 |
|
|
|
14 |
all_data_json = [v.to_dict() for v in raw_data]
|
15 |
|
16 |
df = pd.DataFrame.from_records(all_data_json)
|
17 |
+
# breakpoint()
|
18 |
df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
|
19 |
+
# df = df[cols].round(decimals=2)
|
20 |
|
21 |
# filter out if any of the benchmarks have not been produced
|
22 |
df = df[has_no_nan_values(df, benchmark_cols)]
|
23 |
+
# breakpoint()
|
24 |
return raw_data, df
|
25 |
|
26 |
|