Spaces:
Running
Running
Amber Tanaka
commited on
Add diagram take 2 (#110)
Browse files- assets/code-execution.svg +265 -0
- assets/data-analysis.svg +265 -0
- assets/end-to-end-discovery.svg +265 -0
- assets/literature-understanding.svg +265 -0
- assets/overall.svg +261 -0
- category_page_builder.py +29 -6
- content.py +43 -11
- main_page.py +13 -2
- ui_components.py +1 -1
assets/code-execution.svg
ADDED
|
|
assets/data-analysis.svg
ADDED
|
|
assets/end-to-end-discovery.svg
ADDED
|
|
assets/literature-understanding.svg
ADDED
|
|
assets/overall.svg
ADDED
|
|
category_page_builder.py
CHANGED
|
@@ -3,18 +3,41 @@ import pandas as pd
|
|
| 3 |
|
| 4 |
# Import our UI factories and the data loader
|
| 5 |
from ui_components import create_leaderboard_display, create_benchmark_details_display, get_full_leaderboard_data, create_sub_navigation_bar
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def build_category_page(CATEGORY_NAME, PAGE_DESCRIPTION):
|
| 8 |
with gr.Column(elem_id="page-content-wrapper"):
|
| 9 |
-
gr.HTML(f'<h2>AstaBench {CATEGORY_NAME} Leaderboard <span style="font-weight: normal; color: inherit;">(Aggregate)</span></h2>', elem_id="main-header")
|
| 10 |
validation_df, validation_tag_map = get_full_leaderboard_data("validation")
|
| 11 |
test_df, test_tag_map = get_full_leaderboard_data("test")
|
| 12 |
-
with gr.
|
| 13 |
-
create_sub_navigation_bar(validation_tag_map, CATEGORY_NAME, validation=True)
|
| 14 |
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
# --- This page now has two main sections: Validation and Test ---
|
| 19 |
with gr.Tabs():
|
| 20 |
with gr.Tab("Results: Test Set") as test_tab:
|
|
|
|
| 3 |
|
| 4 |
# Import our UI factories and the data loader
|
| 5 |
from ui_components import create_leaderboard_display, create_benchmark_details_display, get_full_leaderboard_data, create_sub_navigation_bar
|
| 6 |
+
CATEGORY_DIAGRAM_MAP = {
|
| 7 |
+
"Literature Understanding": "assets/literature-understanding.svg",
|
| 8 |
+
"Code & Execution": "assets/code-execution.svg",
|
| 9 |
+
"Data Analysis": "assets/data-analysis.svg",
|
| 10 |
+
"End-to-End Discovery": "assets/end-to-end-discovery.svg",
|
| 11 |
+
}
|
| 12 |
|
| 13 |
def build_category_page(CATEGORY_NAME, PAGE_DESCRIPTION):
|
| 14 |
with gr.Column(elem_id="page-content-wrapper"):
|
|
|
|
| 15 |
validation_df, validation_tag_map = get_full_leaderboard_data("validation")
|
| 16 |
test_df, test_tag_map = get_full_leaderboard_data("test")
|
| 17 |
+
with gr.Row(elem_id="intro-row"):
|
|
|
|
| 18 |
|
| 19 |
+
with gr.Column(scale=1):
|
| 20 |
+
gr.HTML(f'<h2>AstaBench {CATEGORY_NAME} Leaderboard <span style="font-weight: normal; color: inherit;">(Aggregate)</span></h2>', elem_id="main-header")
|
| 21 |
+
with gr.Column(elem_id="validation_nav_container", visible=False) as validation_nav_container:
|
| 22 |
+
create_sub_navigation_bar(validation_tag_map, CATEGORY_NAME, validation=True)
|
| 23 |
+
|
| 24 |
+
with gr.Column(elem_id="test_nav_container", visible=True) as test_nav_container:
|
| 25 |
+
create_sub_navigation_bar(test_tag_map, CATEGORY_NAME)
|
| 26 |
+
|
| 27 |
+
gr.Markdown(PAGE_DESCRIPTION, elem_id="intro-category-paragraph")
|
| 28 |
+
|
| 29 |
+
# --- The Right Column ---
|
| 30 |
+
with gr.Column(scale=1):
|
| 31 |
+
image_path = CATEGORY_DIAGRAM_MAP.get(CATEGORY_NAME)
|
| 32 |
+
if image_path:
|
| 33 |
+
gr.Image(
|
| 34 |
+
value=image_path,
|
| 35 |
+
show_label=False,
|
| 36 |
+
show_download_button=False,
|
| 37 |
+
show_fullscreen_button=False,
|
| 38 |
+
interactive=False,
|
| 39 |
+
elem_id="diagram-image"
|
| 40 |
+
)
|
| 41 |
# --- This page now has two main sections: Validation and Test ---
|
| 42 |
with gr.Tabs():
|
| 43 |
with gr.Tab("Results: Test Set") as test_tab:
|
content.py
CHANGED
|
@@ -254,9 +254,48 @@ h2 {
|
|
| 254 |
|
| 255 |
#intro-paragraph {
|
| 256 |
font-size: 18px;
|
| 257 |
-
max-width:
|
| 258 |
-
padding-left:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 259 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
#about-content {
|
| 261 |
font-size: 18px;
|
| 262 |
max-width: 60%;
|
|
@@ -340,9 +379,9 @@ nav.svelte-ti537g.svelte-ti537g {
|
|
| 340 |
}
|
| 341 |
.sub-nav-bar-container {
|
| 342 |
display: flex !important;
|
| 343 |
-
flex-wrap:
|
| 344 |
align-items: center !important;
|
| 345 |
-
gap:
|
| 346 |
}
|
| 347 |
.dark .primary-link-button {
|
| 348 |
color: var(--color-primary-green);
|
|
@@ -821,13 +860,6 @@ html {
|
|
| 821 |
flex-direction: column;
|
| 822 |
}
|
| 823 |
}
|
| 824 |
-
#home-page-content-wrapper{
|
| 825 |
-
margin: 40px;
|
| 826 |
-
max-width: 60%;
|
| 827 |
-
}
|
| 828 |
-
#intro-paragraph {
|
| 829 |
-
max-width: 90%;
|
| 830 |
-
}
|
| 831 |
/* Plot legend styles */
|
| 832 |
.plot-legend-container {
|
| 833 |
min-height: 572px;
|
|
|
|
| 254 |
|
| 255 |
#intro-paragraph {
|
| 256 |
font-size: 18px;
|
| 257 |
+
max-width: 90%;
|
| 258 |
+
padding-left: 35px;
|
| 259 |
+
margin-top: 20px;
|
| 260 |
+
}
|
| 261 |
+
|
| 262 |
+
#intro-paragraph p,
|
| 263 |
+
#intro-paragraph li {
|
| 264 |
+
font-size: 16px;
|
| 265 |
+
line-height: 1.8;
|
| 266 |
+
}
|
| 267 |
+
|
| 268 |
+
#intro-paragraph ul {
|
| 269 |
+
margin-top: 20px;
|
| 270 |
+
margin-bottom: 20px;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
#diagram-image {
|
| 274 |
+
height: 100%;
|
| 275 |
}
|
| 276 |
+
|
| 277 |
+
#diagram-image img {
|
| 278 |
+
width: 100%;
|
| 279 |
+
height: 100%;
|
| 280 |
+
object-fit: cover;
|
| 281 |
+
}
|
| 282 |
+
#intro-category-paragraph {
|
| 283 |
+
font-size: 18px;
|
| 284 |
+
max-width: 90%;
|
| 285 |
+
margin-top: 20px;
|
| 286 |
+
}
|
| 287 |
+
|
| 288 |
+
#intro-category-paragraph p,
|
| 289 |
+
#intro-category-paragraph li {
|
| 290 |
+
font-size: 16px;
|
| 291 |
+
line-height: 1.8;
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
#intro-category-paragraph ul {
|
| 295 |
+
margin-top: 20px;
|
| 296 |
+
margin-bottom: 20px;
|
| 297 |
+
}
|
| 298 |
+
|
| 299 |
#about-content {
|
| 300 |
font-size: 18px;
|
| 301 |
max-width: 60%;
|
|
|
|
| 379 |
}
|
| 380 |
.sub-nav-bar-container {
|
| 381 |
display: flex !important;
|
| 382 |
+
flex-wrap: wrap !important;
|
| 383 |
align-items: center !important;
|
| 384 |
+
gap: 10px !important;
|
| 385 |
}
|
| 386 |
.dark .primary-link-button {
|
| 387 |
color: var(--color-primary-green);
|
|
|
|
| 860 |
flex-direction: column;
|
| 861 |
}
|
| 862 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 863 |
/* Plot legend styles */
|
| 864 |
.plot-legend-container {
|
| 865 |
min-height: 572px;
|
main_page.py
CHANGED
|
@@ -16,8 +16,19 @@ CACHED_VIEWERS = {}
|
|
| 16 |
CACHED_TAG_MAPS = {}
|
| 17 |
|
| 18 |
def build_page():
|
| 19 |
-
with gr.
|
| 20 |
-
gr.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
# --- Leaderboard Display Section ---
|
| 23 |
gr.Markdown("---")
|
|
|
|
| 16 |
CACHED_TAG_MAPS = {}
|
| 17 |
|
| 18 |
def build_page():
|
| 19 |
+
with gr.Row(elem_id="intro-row"):
|
| 20 |
+
with gr.Column(scale=1):
|
| 21 |
+
gr.HTML(INTRO_PARAGRAPH, elem_id="intro-paragraph")
|
| 22 |
+
|
| 23 |
+
with gr.Column(scale=1):
|
| 24 |
+
gr.Image(
|
| 25 |
+
value="assets/overall.svg",
|
| 26 |
+
show_label=False,
|
| 27 |
+
interactive=False,
|
| 28 |
+
show_download_button=False,
|
| 29 |
+
show_fullscreen_button=False,
|
| 30 |
+
elem_id="diagram-image"
|
| 31 |
+
)
|
| 32 |
|
| 33 |
# --- Leaderboard Display Section ---
|
| 34 |
gr.Markdown("---")
|
ui_components.py
CHANGED
|
@@ -857,7 +857,7 @@ def create_sub_navigation_bar(tag_map: dict, category_name: str, validation: boo
|
|
| 857 |
full_html = f"""
|
| 858 |
<div class="sub-nav-bar-container">
|
| 859 |
<span class="sub-nav-label">Benchmarks in this category:</span>
|
| 860 |
-
{''.join(html_buttons)}
|
| 861 |
</div>
|
| 862 |
"""
|
| 863 |
|
|
|
|
| 857 |
full_html = f"""
|
| 858 |
<div class="sub-nav-bar-container">
|
| 859 |
<span class="sub-nav-label">Benchmarks in this category:</span>
|
| 860 |
+
{' | '.join(html_buttons)}
|
| 861 |
</div>
|
| 862 |
"""
|
| 863 |
|