Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -156,6 +156,8 @@ def get_full_table(model_table_df):
|
|
156 |
values = []
|
157 |
for i in range(len(model_table_df)):
|
158 |
row = []
|
|
|
|
|
159 |
model_key = model_table_df.iloc[i]["key"]
|
160 |
model_name = model_table_df.iloc[i]["Model"]
|
161 |
# model display name
|
@@ -163,10 +165,8 @@ def get_full_table(model_table_df):
|
|
163 |
row.append(np.nan)
|
164 |
row.append(np.nan)
|
165 |
row.append(np.nan)\
|
166 |
-
#
|
167 |
-
row.append(model_table_df.iloc[i]["
|
168 |
-
# license
|
169 |
-
row.append(model_table_df.iloc[i]["License"])
|
170 |
|
171 |
values.append(row)
|
172 |
values.sort(key=lambda x: -x[1] if not np.isnan(x[1]) else 1e9)
|
@@ -222,8 +222,7 @@ def build_leaderboard_tab(results_file, leaderboard_table_file, show_plot=False)
|
|
222 |
"β Task 1",
|
223 |
"π Task 2",
|
224 |
"π Task 3",
|
225 |
-
"
|
226 |
-
"License",
|
227 |
],
|
228 |
datatype=[
|
229 |
"number",
|
@@ -232,12 +231,11 @@ def build_leaderboard_tab(results_file, leaderboard_table_file, show_plot=False)
|
|
232 |
"number",
|
233 |
"number",
|
234 |
"str",
|
235 |
-
"str",
|
236 |
],
|
237 |
value=arena_table_vals,
|
238 |
elem_id="arena_leaderboard_dataframe",
|
239 |
height=700,
|
240 |
-
column_widths=[70, 190, 110, 110, 110, 150
|
241 |
wrap=True,
|
242 |
)
|
243 |
|
@@ -259,7 +257,7 @@ def build_leaderboard_tab(results_file, leaderboard_table_file, show_plot=False)
|
|
259 |
pass
|
260 |
|
261 |
def update_leaderboard_df(arena_table_vals):
|
262 |
-
elo_datarame = pd.DataFrame(arena_table_vals, columns=["Rank", "π€ Model", "β Task 1", "π Task 2", "π Task 3", "
|
263 |
|
264 |
# goal: color the rows based on the rank with styler
|
265 |
def highlight_max(s):
|
@@ -286,8 +284,7 @@ def build_leaderboard_tab(results_file, leaderboard_table_file, show_plot=False)
|
|
286 |
"β Task 1",
|
287 |
"π Task 2",
|
288 |
"π Task 3",
|
289 |
-
"
|
290 |
-
"License",
|
291 |
],
|
292 |
datatype=[
|
293 |
"number",
|
@@ -296,12 +293,11 @@ def build_leaderboard_tab(results_file, leaderboard_table_file, show_plot=False)
|
|
296 |
"number",
|
297 |
"number",
|
298 |
"str",
|
299 |
-
"str",
|
300 |
],
|
301 |
value=arena_values,
|
302 |
elem_id="arena_leaderboard_dataframe",
|
303 |
height=700,
|
304 |
-
column_widths=[70, 190, 110, 110, 110, 150
|
305 |
wrap=True,
|
306 |
)
|
307 |
leaderboard_md = make_category_arena_leaderboard_md(arena_df, arena_subset_df, name=category)
|
|
|
156 |
values = []
|
157 |
for i in range(len(model_table_df)):
|
158 |
row = []
|
159 |
+
ranking = arena_df.iloc[i].get("final_ranking") or i+1
|
160 |
+
row.append(ranking)
|
161 |
model_key = model_table_df.iloc[i]["key"]
|
162 |
model_name = model_table_df.iloc[i]["Model"]
|
163 |
# model display name
|
|
|
165 |
row.append(np.nan)
|
166 |
row.append(np.nan)
|
167 |
row.append(np.nan)\
|
168 |
+
# Team
|
169 |
+
row.append(model_table_df.iloc[i]["Team"])
|
|
|
|
|
170 |
|
171 |
values.append(row)
|
172 |
values.sort(key=lambda x: -x[1] if not np.isnan(x[1]) else 1e9)
|
|
|
222 |
"β Task 1",
|
223 |
"π Task 2",
|
224 |
"π Task 3",
|
225 |
+
"Team",
|
|
|
226 |
],
|
227 |
datatype=[
|
228 |
"number",
|
|
|
231 |
"number",
|
232 |
"number",
|
233 |
"str",
|
|
|
234 |
],
|
235 |
value=arena_table_vals,
|
236 |
elem_id="arena_leaderboard_dataframe",
|
237 |
height=700,
|
238 |
+
column_widths=[70, 190, 110, 110, 110, 150],
|
239 |
wrap=True,
|
240 |
)
|
241 |
|
|
|
257 |
pass
|
258 |
|
259 |
def update_leaderboard_df(arena_table_vals):
|
260 |
+
elo_datarame = pd.DataFrame(arena_table_vals, columns=["Rank", "π€ Model", "β Task 1", "π Task 2", "π Task 3", "Team"])
|
261 |
|
262 |
# goal: color the rows based on the rank with styler
|
263 |
def highlight_max(s):
|
|
|
284 |
"β Task 1",
|
285 |
"π Task 2",
|
286 |
"π Task 3",
|
287 |
+
"Team",
|
|
|
288 |
],
|
289 |
datatype=[
|
290 |
"number",
|
|
|
293 |
"number",
|
294 |
"number",
|
295 |
"str",
|
|
|
296 |
],
|
297 |
value=arena_values,
|
298 |
elem_id="arena_leaderboard_dataframe",
|
299 |
height=700,
|
300 |
+
column_widths=[70, 190, 110, 110, 110, 150],
|
301 |
wrap=True,
|
302 |
)
|
303 |
leaderboard_md = make_category_arena_leaderboard_md(arena_df, arena_subset_df, name=category)
|