Spaces:
Runtime error
Runtime error
jasonshaoshun commited on
Commit ·
f732437
1
Parent(s): 85b6004
debug
Browse files- app.py +2 -2
- src/display/utils.py +23 -13
app.py
CHANGED
|
@@ -405,9 +405,9 @@ def init_leaderboard_mib_subgraph(dataframe, track):
|
|
| 405 |
# Extract unique benchmarks and models from column names
|
| 406 |
for col in result_columns:
|
| 407 |
print(f"col is {col}")
|
| 408 |
-
benchmark, model = col.split('
|
| 409 |
benchmarks.add(benchmark)
|
| 410 |
-
models.add(model
|
| 411 |
print(f"benchmark is {benchmark} and model is {model}")
|
| 412 |
|
| 413 |
# Create selection groups
|
|
|
|
| 405 |
# Extract unique benchmarks and models from column names
|
| 406 |
for col in result_columns:
|
| 407 |
print(f"col is {col}")
|
| 408 |
+
benchmark, model = col.split('-')
|
| 409 |
benchmarks.add(benchmark)
|
| 410 |
+
models.add(model)
|
| 411 |
print(f"benchmark is {benchmark} and model is {model}")
|
| 412 |
|
| 413 |
# Create selection groups
|
src/display/utils.py
CHANGED
|
@@ -119,27 +119,37 @@ AutoEvalColumnMultimodal = make_dataclass("AutoEvalColumnMultimodal", auto_eval_
|
|
| 119 |
|
| 120 |
##############################################################################################################
|
| 121 |
# Version 3
|
| 122 |
-
auto_eval_column_dict_mib_subgraph = []
|
| 123 |
|
| 124 |
-
#
|
| 125 |
-
auto_eval_column_dict_mib_subgraph
|
| 126 |
|
| 127 |
-
#
|
| 128 |
-
auto_eval_column_dict_mib_subgraph.append(
|
| 129 |
-
|
|
|
|
| 130 |
|
| 131 |
-
#
|
| 132 |
for task in TasksMib_Subgraph:
|
| 133 |
for model in task.value.models:
|
| 134 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
auto_eval_column_dict_mib_subgraph.append([
|
| 136 |
-
|
| 137 |
-
ColumnContent,
|
| 138 |
-
ColumnContent(
|
| 139 |
])
|
| 140 |
|
| 141 |
-
# Average column
|
| 142 |
-
auto_eval_column_dict_mib_subgraph.append(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
|
| 145 |
|
|
|
|
| 119 |
|
| 120 |
##############################################################################################################
|
| 121 |
# Version 3
|
|
|
|
| 122 |
|
| 123 |
+
# First, let's create field names that are valid Python identifiers
|
| 124 |
+
auto_eval_column_dict_mib_subgraph = []
|
| 125 |
|
| 126 |
+
# Method name column (always present)
|
| 127 |
+
auto_eval_column_dict_mib_subgraph.append(
|
| 128 |
+
["method", ColumnContent, ColumnContent("Method", "markdown", True, never_hidden=True)]
|
| 129 |
+
)
|
| 130 |
|
| 131 |
+
# Add columns for each task-model combination
|
| 132 |
for task in TasksMib_Subgraph:
|
| 133 |
for model in task.value.models:
|
| 134 |
+
# Create a valid field name by using underscores
|
| 135 |
+
field_name = f"{task.value.benchmark}-{model}"
|
| 136 |
+
# The display name can be more descriptive
|
| 137 |
+
display_name = f"{task.value.benchmark}({model})"
|
| 138 |
+
|
| 139 |
auto_eval_column_dict_mib_subgraph.append([
|
| 140 |
+
field_name, # This must be a valid Python identifier
|
| 141 |
+
ColumnContent,
|
| 142 |
+
ColumnContent(display_name, "number", True)
|
| 143 |
])
|
| 144 |
|
| 145 |
+
# Add the Average column
|
| 146 |
+
auto_eval_column_dict_mib_subgraph.append(
|
| 147 |
+
["average", ColumnContent, ColumnContent("Average", "number", True)]
|
| 148 |
+
)
|
| 149 |
+
|
| 150 |
+
print("Debug - Column field names:")
|
| 151 |
+
for field in auto_eval_column_dict_mib_subgraph:
|
| 152 |
+
print(f"Field name: {field[0]}, Display name: {field[2].name}")
|
| 153 |
|
| 154 |
|
| 155 |
|