Spaces:
Running
Running
Jae-Won Chung
commited on
Commit
·
a57f7ec
1
Parent(s):
03304c1
Colosseum down
Browse files
app.py
CHANGED
|
@@ -26,7 +26,7 @@ import pandas as pd
|
|
| 26 |
|
| 27 |
from spitfight.colosseum.client import ControllerClient
|
| 28 |
|
| 29 |
-
COLOSSEUM_UP =
|
| 30 |
COLOSSEUM_DOWN_MESSAGE = f"<br/><h2 style='text-align: center'>The Colosseum is currently down for maintenance.</h2>"
|
| 31 |
COLOSSUMM_YOUTUBE_DEMO_EMBED_HTML = '<div style="width: 100%; min-width: 400px;"><div style="position: relative; width: 100%; overflow: hidden; padding-top: 56.25%"><p><iframe width="560" height="315" style="margin: auto; position: absolute; top: 0; left: 0; right: 0; width: 100%; height: 100%; border: none;" src="https://www.youtube.com/embed/tvNM_gLffFs?si=rW1-10pt5BffJEGH" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe><p></div></div>'
|
| 32 |
|
|
@@ -1200,13 +1200,112 @@ with gr.Blocks(css=custom_css) as block:
|
|
| 1200 |
)
|
| 1201 |
|
| 1202 |
with gr.Tabs():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1203 |
# Tab: Colosseum.
|
| 1204 |
with gr.Tab("Colosseum ⚔️️"):
|
| 1205 |
if COLOSSEUM_UP:
|
| 1206 |
gr.Markdown(open("docs/colosseum_top.md").read())
|
| 1207 |
else:
|
| 1208 |
gr.HTML(COLOSSEUM_DOWN_MESSAGE)
|
| 1209 |
-
gr.HTML("<h3 style='text-align: center'>The energy
|
| 1210 |
gr.HTML(COLOSSUMM_YOUTUBE_DEMO_EMBED_HTML)
|
| 1211 |
|
| 1212 |
with gr.Group():
|
|
@@ -1341,105 +1440,6 @@ with gr.Blocks(css=custom_css) as block:
|
|
| 1341 |
)
|
| 1342 |
.then(None, _js=focus_prompt_input_js, queue=False))
|
| 1343 |
|
| 1344 |
-
# Tab: Leaderboards.
|
| 1345 |
-
dataframes = []
|
| 1346 |
-
all_detail_mode_checkboxes = []
|
| 1347 |
-
all_sliders = []
|
| 1348 |
-
all_detail_text_components = []
|
| 1349 |
-
for global_tbm, local_tbm in zip(global_tbms, local_tbms):
|
| 1350 |
-
with gr.Tab(global_tbm.get_tab_name()):
|
| 1351 |
-
# Box: Introduction text.
|
| 1352 |
-
with gr.Box():
|
| 1353 |
-
gr.Markdown(global_tbm.get_intro_text())
|
| 1354 |
-
|
| 1355 |
-
# Block: Checkboxes and sliders to select benchmarking parameters. A detail mode checkbox.
|
| 1356 |
-
with gr.Row():
|
| 1357 |
-
checkboxes: list[gr.CheckboxGroup] = []
|
| 1358 |
-
for key, choices in global_tbm.get_benchmark_checkboxes().items():
|
| 1359 |
-
# Check the first element by default.
|
| 1360 |
-
checkboxes.append(gr.CheckboxGroup(choices=choices, value=choices[:1], label=key))
|
| 1361 |
-
|
| 1362 |
-
sliders: list[gr.Slider] = []
|
| 1363 |
-
for key, (min_val, max_val, step, default) in global_tbm.get_benchmark_sliders().items():
|
| 1364 |
-
sliders.append(gr.Slider(minimum=min_val, maximum=max_val, value=default, step=step, label=key, visible=detail_mode.value))
|
| 1365 |
-
all_sliders.extend(sliders)
|
| 1366 |
-
|
| 1367 |
-
with gr.Row():
|
| 1368 |
-
detail_mode_checkbox = gr.Checkbox(label="Show more technical details", value=False)
|
| 1369 |
-
all_detail_mode_checkboxes.append(detail_mode_checkbox)
|
| 1370 |
-
|
| 1371 |
-
# Block: Leaderboard table.
|
| 1372 |
-
with gr.Row():
|
| 1373 |
-
dataframe = gr.Dataframe(
|
| 1374 |
-
type="pandas",
|
| 1375 |
-
elem_classes=["tab-leaderboard"],
|
| 1376 |
-
interactive=False,
|
| 1377 |
-
max_rows=1000,
|
| 1378 |
-
)
|
| 1379 |
-
dataframes.append(dataframe)
|
| 1380 |
-
|
| 1381 |
-
# Make sure the models have clickable links.
|
| 1382 |
-
dataframe.change(
|
| 1383 |
-
None, None, None, _js=dataframe_update_js, queue=False
|
| 1384 |
-
)
|
| 1385 |
-
# Table automatically updates when users check or uncheck any checkbox or move any slider.
|
| 1386 |
-
for element in [detail_mode_checkbox, *checkboxes, *sliders]:
|
| 1387 |
-
element.change(
|
| 1388 |
-
global_tbm.__class__.set_filter_get_df,
|
| 1389 |
-
inputs=[local_tbm, detail_mode, *checkboxes, *sliders],
|
| 1390 |
-
outputs=dataframe,
|
| 1391 |
-
queue=False,
|
| 1392 |
-
)
|
| 1393 |
-
|
| 1394 |
-
# Block: More details about the leaderboard.
|
| 1395 |
-
with gr.Box():
|
| 1396 |
-
detail_text = global_tbm.get_detail_text(detail_mode=False)
|
| 1397 |
-
all_detail_text_components.append(gr.Markdown(detail_text))
|
| 1398 |
-
|
| 1399 |
-
# Block: Leaderboard date.
|
| 1400 |
-
with gr.Row():
|
| 1401 |
-
gr.HTML(
|
| 1402 |
-
f"<h3 style='color: gray'>Last updated: {current_date}</h3>"
|
| 1403 |
-
)
|
| 1404 |
-
|
| 1405 |
-
# Tab: Legacy leaderboard.
|
| 1406 |
-
with gr.Tab("LLM Leaderboard (legacy)"):
|
| 1407 |
-
with gr.Box():
|
| 1408 |
-
gr.Markdown(global_ltbm.get_intro_text())
|
| 1409 |
-
|
| 1410 |
-
# Block: Checkboxes to select benchmarking parameters.
|
| 1411 |
-
with gr.Row():
|
| 1412 |
-
with gr.Box():
|
| 1413 |
-
gr.Markdown("### Benchmark results to show")
|
| 1414 |
-
checkboxes: list[gr.CheckboxGroup] = []
|
| 1415 |
-
for key, choices in global_ltbm.schema.items():
|
| 1416 |
-
# Specifying `value` makes everything checked by default.
|
| 1417 |
-
checkboxes.append(
|
| 1418 |
-
gr.CheckboxGroup(
|
| 1419 |
-
choices=choices, value=choices[:1], label=key
|
| 1420 |
-
)
|
| 1421 |
-
)
|
| 1422 |
-
|
| 1423 |
-
# Block: Leaderboard table.
|
| 1424 |
-
with gr.Row():
|
| 1425 |
-
dataframe = gr.Dataframe(
|
| 1426 |
-
type="pandas", elem_classes=["tab-leaderboard"], interactive=False
|
| 1427 |
-
)
|
| 1428 |
-
# Make sure the models have clickable links.
|
| 1429 |
-
dataframe.change(None, None, None, _js=dataframe_update_js, queue=False)
|
| 1430 |
-
# Table automatically updates when users check or uncheck any checkbox.
|
| 1431 |
-
for checkbox in checkboxes:
|
| 1432 |
-
checkbox.change(
|
| 1433 |
-
LegacyTableManager.set_filter_get_df,
|
| 1434 |
-
inputs=[tbm, *checkboxes],
|
| 1435 |
-
outputs=dataframe,
|
| 1436 |
-
queue=False,
|
| 1437 |
-
)
|
| 1438 |
-
|
| 1439 |
-
# Block: Leaderboard date.
|
| 1440 |
-
with gr.Row():
|
| 1441 |
-
gr.HTML(f"<h3 style='color: gray'>Last updated: {current_date}</h3>")
|
| 1442 |
-
|
| 1443 |
# Tab: About page.
|
| 1444 |
with gr.Tab("About"):
|
| 1445 |
gr.Markdown(open("docs/about.md").read())
|
|
|
|
| 26 |
|
| 27 |
from spitfight.colosseum.client import ControllerClient
|
| 28 |
|
| 29 |
+
COLOSSEUM_UP = False
|
| 30 |
COLOSSEUM_DOWN_MESSAGE = f"<br/><h2 style='text-align: center'>The Colosseum is currently down for maintenance.</h2>"
|
| 31 |
COLOSSUMM_YOUTUBE_DEMO_EMBED_HTML = '<div style="width: 100%; min-width: 400px;"><div style="position: relative; width: 100%; overflow: hidden; padding-top: 56.25%"><p><iframe width="560" height="315" style="margin: auto; position: absolute; top: 0; left: 0; right: 0; width: 100%; height: 100%; border: none;" src="https://www.youtube.com/embed/tvNM_gLffFs?si=rW1-10pt5BffJEGH" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe><p></div></div>'
|
| 32 |
|
|
|
|
| 1200 |
)
|
| 1201 |
|
| 1202 |
with gr.Tabs():
|
| 1203 |
+
# Tab: Leaderboards.
|
| 1204 |
+
dataframes = []
|
| 1205 |
+
all_detail_mode_checkboxes = []
|
| 1206 |
+
all_sliders = []
|
| 1207 |
+
all_detail_text_components = []
|
| 1208 |
+
for global_tbm, local_tbm in zip(global_tbms, local_tbms):
|
| 1209 |
+
with gr.Tab(global_tbm.get_tab_name()):
|
| 1210 |
+
# Box: Introduction text.
|
| 1211 |
+
with gr.Box():
|
| 1212 |
+
gr.Markdown(global_tbm.get_intro_text())
|
| 1213 |
+
|
| 1214 |
+
# Block: Checkboxes and sliders to select benchmarking parameters. A detail mode checkbox.
|
| 1215 |
+
with gr.Row():
|
| 1216 |
+
checkboxes: list[gr.CheckboxGroup] = []
|
| 1217 |
+
for key, choices in global_tbm.get_benchmark_checkboxes().items():
|
| 1218 |
+
# Check the first element by default.
|
| 1219 |
+
checkboxes.append(gr.CheckboxGroup(choices=choices, value=choices[:1], label=key))
|
| 1220 |
+
|
| 1221 |
+
sliders: list[gr.Slider] = []
|
| 1222 |
+
for key, (min_val, max_val, step, default) in global_tbm.get_benchmark_sliders().items():
|
| 1223 |
+
sliders.append(gr.Slider(minimum=min_val, maximum=max_val, value=default, step=step, label=key, visible=detail_mode.value))
|
| 1224 |
+
all_sliders.extend(sliders)
|
| 1225 |
+
|
| 1226 |
+
with gr.Row():
|
| 1227 |
+
detail_mode_checkbox = gr.Checkbox(label="Show more technical details", value=False)
|
| 1228 |
+
all_detail_mode_checkboxes.append(detail_mode_checkbox)
|
| 1229 |
+
|
| 1230 |
+
# Block: Leaderboard table.
|
| 1231 |
+
with gr.Row():
|
| 1232 |
+
dataframe = gr.Dataframe(
|
| 1233 |
+
type="pandas",
|
| 1234 |
+
elem_classes=["tab-leaderboard"],
|
| 1235 |
+
interactive=False,
|
| 1236 |
+
max_rows=1000,
|
| 1237 |
+
)
|
| 1238 |
+
dataframes.append(dataframe)
|
| 1239 |
+
|
| 1240 |
+
# Make sure the models have clickable links.
|
| 1241 |
+
dataframe.change(
|
| 1242 |
+
None, None, None, _js=dataframe_update_js, queue=False
|
| 1243 |
+
)
|
| 1244 |
+
# Table automatically updates when users check or uncheck any checkbox or move any slider.
|
| 1245 |
+
for element in [detail_mode_checkbox, *checkboxes, *sliders]:
|
| 1246 |
+
element.change(
|
| 1247 |
+
global_tbm.__class__.set_filter_get_df,
|
| 1248 |
+
inputs=[local_tbm, detail_mode, *checkboxes, *sliders],
|
| 1249 |
+
outputs=dataframe,
|
| 1250 |
+
queue=False,
|
| 1251 |
+
)
|
| 1252 |
+
|
| 1253 |
+
# Block: More details about the leaderboard.
|
| 1254 |
+
with gr.Box():
|
| 1255 |
+
detail_text = global_tbm.get_detail_text(detail_mode=False)
|
| 1256 |
+
all_detail_text_components.append(gr.Markdown(detail_text))
|
| 1257 |
+
|
| 1258 |
+
# Block: Leaderboard date.
|
| 1259 |
+
with gr.Row():
|
| 1260 |
+
gr.HTML(
|
| 1261 |
+
f"<h3 style='color: gray'>Last updated: {current_date}</h3>"
|
| 1262 |
+
)
|
| 1263 |
+
|
| 1264 |
+
# Tab: Legacy leaderboard.
|
| 1265 |
+
with gr.Tab("LLM Leaderboard (legacy)"):
|
| 1266 |
+
with gr.Box():
|
| 1267 |
+
gr.Markdown(global_ltbm.get_intro_text())
|
| 1268 |
+
|
| 1269 |
+
# Block: Checkboxes to select benchmarking parameters.
|
| 1270 |
+
with gr.Row():
|
| 1271 |
+
with gr.Box():
|
| 1272 |
+
gr.Markdown("### Benchmark results to show")
|
| 1273 |
+
checkboxes: list[gr.CheckboxGroup] = []
|
| 1274 |
+
for key, choices in global_ltbm.schema.items():
|
| 1275 |
+
# Specifying `value` makes everything checked by default.
|
| 1276 |
+
checkboxes.append(
|
| 1277 |
+
gr.CheckboxGroup(
|
| 1278 |
+
choices=choices, value=choices[:1], label=key
|
| 1279 |
+
)
|
| 1280 |
+
)
|
| 1281 |
+
|
| 1282 |
+
# Block: Leaderboard table.
|
| 1283 |
+
with gr.Row():
|
| 1284 |
+
dataframe = gr.Dataframe(
|
| 1285 |
+
type="pandas", elem_classes=["tab-leaderboard"], interactive=False
|
| 1286 |
+
)
|
| 1287 |
+
# Make sure the models have clickable links.
|
| 1288 |
+
dataframe.change(None, None, None, _js=dataframe_update_js, queue=False)
|
| 1289 |
+
# Table automatically updates when users check or uncheck any checkbox.
|
| 1290 |
+
for checkbox in checkboxes:
|
| 1291 |
+
checkbox.change(
|
| 1292 |
+
LegacyTableManager.set_filter_get_df,
|
| 1293 |
+
inputs=[tbm, *checkboxes],
|
| 1294 |
+
outputs=dataframe,
|
| 1295 |
+
queue=False,
|
| 1296 |
+
)
|
| 1297 |
+
|
| 1298 |
+
# Block: Leaderboard date.
|
| 1299 |
+
with gr.Row():
|
| 1300 |
+
gr.HTML(f"<h3 style='color: gray'>Last updated: {current_date}</h3>")
|
| 1301 |
+
|
| 1302 |
# Tab: Colosseum.
|
| 1303 |
with gr.Tab("Colosseum ⚔️️"):
|
| 1304 |
if COLOSSEUM_UP:
|
| 1305 |
gr.Markdown(open("docs/colosseum_top.md").read())
|
| 1306 |
else:
|
| 1307 |
gr.HTML(COLOSSEUM_DOWN_MESSAGE)
|
| 1308 |
+
gr.HTML("<h3 style='text-align: center'>The energy leaderboards are still available.</h3><br/>")
|
| 1309 |
gr.HTML(COLOSSUMM_YOUTUBE_DEMO_EMBED_HTML)
|
| 1310 |
|
| 1311 |
with gr.Group():
|
|
|
|
| 1440 |
)
|
| 1441 |
.then(None, _js=focus_prompt_input_js, queue=False))
|
| 1442 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1443 |
# Tab: About page.
|
| 1444 |
with gr.Tab("About"):
|
| 1445 |
gr.Markdown(open("docs/about.md").read())
|