Spaces:
Running
Running
finetune header formats
Browse files- app.py +2 -2
- static/css/style.css +2 -2
- utils.py +12 -5
app.py
CHANGED
|
@@ -82,7 +82,7 @@ with gr.Blocks() as block:
|
|
| 82 |
interactive=False,
|
| 83 |
elem_classes="custom-dataframe",
|
| 84 |
max_height=2400,
|
| 85 |
-
column_widths=["100px", "240px"] + ["160px"] * 3 + ["
|
| 86 |
)
|
| 87 |
|
| 88 |
def update_table_and_caption(table_type, super_group, model_group):
|
|
@@ -99,7 +99,7 @@ with gr.Blocks() as block:
|
|
| 99 |
headers=headers,
|
| 100 |
datatype=["number", "html"] + ["number"] * (len(headers) - 2),
|
| 101 |
interactive=False,
|
| 102 |
-
column_widths=["100px", "240px"] + ["160px"] * 3 + ["
|
| 103 |
),
|
| 104 |
caption,
|
| 105 |
f"<style>{base_css}\n{table_css}</style>"
|
|
|
|
| 82 |
interactive=False,
|
| 83 |
elem_classes="custom-dataframe",
|
| 84 |
max_height=2400,
|
| 85 |
+
column_widths=["100px", "240px"] + ["160px"] * 3 + ["210px"] * (len(initial_headers) - 5),
|
| 86 |
)
|
| 87 |
|
| 88 |
def update_table_and_caption(table_type, super_group, model_group):
|
|
|
|
| 99 |
headers=headers,
|
| 100 |
datatype=["number", "html"] + ["number"] * (len(headers) - 2),
|
| 101 |
interactive=False,
|
| 102 |
+
column_widths=["100px", "240px"] + ["160px"] * 3 + ["210px"] * (len(headers) - 5),
|
| 103 |
),
|
| 104 |
caption,
|
| 105 |
f"<style>{base_css}\n{table_css}</style>"
|
static/css/style.css
CHANGED
|
@@ -84,9 +84,9 @@
|
|
| 84 |
/* Dimension columns */
|
| 85 |
.custom-dataframe td:nth-child(n+6),
|
| 86 |
.custom-dataframe th:nth-child(n+6) {
|
| 87 |
-
width:
|
| 88 |
min-width: 160px !important;
|
| 89 |
-
max-width:
|
| 90 |
text-align: center !important;
|
| 91 |
}
|
| 92 |
|
|
|
|
| 84 |
/* Dimension columns */
|
| 85 |
.custom-dataframe td:nth-child(n+6),
|
| 86 |
.custom-dataframe th:nth-child(n+6) {
|
| 87 |
+
width: 210px !important;
|
| 88 |
min-width: 160px !important;
|
| 89 |
+
max-width: 210px !important;
|
| 90 |
text-align: center !important;
|
| 91 |
}
|
| 92 |
|
utils.py
CHANGED
|
@@ -128,13 +128,13 @@ class MEGABenchEvalDataLoader:
|
|
| 128 |
total_open_tasks = self.SUMMARY_DATA[sample_model]["open"]["num_eval_tasks"]
|
| 129 |
total_tasks = total_core_tasks + total_open_tasks
|
| 130 |
|
| 131 |
-
# Define headers with task counts
|
| 132 |
column_headers = {
|
| 133 |
"Rank": "Rank",
|
| 134 |
"Models": "Models",
|
| 135 |
-
"Overall": f"Overall({total_tasks})",
|
| 136 |
-
"Core": f"Core({total_core_tasks})",
|
| 137 |
-
"Open-ended": f"Open-ended({total_open_tasks})"
|
| 138 |
}
|
| 139 |
|
| 140 |
# Add rank column to DataFrame
|
|
@@ -144,13 +144,20 @@ class MEGABenchEvalDataLoader:
|
|
| 144 |
# Rename the columns in DataFrame to match headers
|
| 145 |
df = df.rename(columns=column_headers)
|
| 146 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
headers = [
|
| 148 |
column_headers["Rank"],
|
| 149 |
column_headers["Models"],
|
| 150 |
column_headers["Overall"],
|
| 151 |
column_headers["Core"],
|
| 152 |
column_headers["Open-ended"]
|
| 153 |
-
] +
|
| 154 |
|
| 155 |
data = df[[
|
| 156 |
column_headers["Rank"],
|
|
|
|
| 128 |
total_open_tasks = self.SUMMARY_DATA[sample_model]["open"]["num_eval_tasks"]
|
| 129 |
total_tasks = total_core_tasks + total_open_tasks
|
| 130 |
|
| 131 |
+
# Define headers with task counts on new line using Unicode line break
|
| 132 |
column_headers = {
|
| 133 |
"Rank": "Rank",
|
| 134 |
"Models": "Models",
|
| 135 |
+
"Overall": f"Overall\n({total_tasks})",
|
| 136 |
+
"Core": f"Core\n({total_core_tasks})",
|
| 137 |
+
"Open-ended": f"Open-ended\n({total_open_tasks})"
|
| 138 |
}
|
| 139 |
|
| 140 |
# Add rank column to DataFrame
|
|
|
|
| 144 |
# Rename the columns in DataFrame to match headers
|
| 145 |
df = df.rename(columns=column_headers)
|
| 146 |
|
| 147 |
+
# For dimension columns, add task counts on new line
|
| 148 |
+
dimension_headers = []
|
| 149 |
+
for display_name in self.SUPER_GROUPS[selected_super_group]:
|
| 150 |
+
task_count = display_name.split('(')[1].rstrip(')')
|
| 151 |
+
base_name = display_name.split('(')[0]
|
| 152 |
+
dimension_headers.append(f"{base_name}\n({task_count})")
|
| 153 |
+
|
| 154 |
headers = [
|
| 155 |
column_headers["Rank"],
|
| 156 |
column_headers["Models"],
|
| 157 |
column_headers["Overall"],
|
| 158 |
column_headers["Core"],
|
| 159 |
column_headers["Open-ended"]
|
| 160 |
+
] + dimension_headers
|
| 161 |
|
| 162 |
data = df[[
|
| 163 |
column_headers["Rank"],
|