Spaces:
Running
Running
jasonshaoshun
commited on
Commit
·
4493851
1
Parent(s):
1eaca05
debug
Browse files- app.py +20 -0
- src/display/utils.py +22 -4
app.py
CHANGED
|
@@ -149,6 +149,26 @@ def init_leaderboard_mib_causalgraph(dataframe, track):
|
|
| 149 |
interactive=False,
|
| 150 |
)
|
| 151 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 152 |
|
| 153 |
def init_leaderboard(dataframe, track):
|
| 154 |
if dataframe is None or dataframe.empty:
|
|
|
|
| 149 |
interactive=False,
|
| 150 |
)
|
| 151 |
|
| 152 |
+
def init_leaderboard_mib_causalgraph(dataframe, track):
|
| 153 |
+
print("Debugging column issues:")
|
| 154 |
+
print("\nActual DataFrame columns:")
|
| 155 |
+
print(dataframe.columns.tolist())
|
| 156 |
+
|
| 157 |
+
# Create only necessary columns
|
| 158 |
+
return Leaderboard(
|
| 159 |
+
value=dataframe,
|
| 160 |
+
datatype=[c.type for c in fields(AutoEvalColumn_mib_causalgraph)],
|
| 161 |
+
select_columns=SelectColumns(
|
| 162 |
+
default_selection=["Method"], # Start with just Method column
|
| 163 |
+
cant_deselect=["Method"], # Method column should always be visible
|
| 164 |
+
label="Select Columns to Display:",
|
| 165 |
+
),
|
| 166 |
+
search_columns=["Method"],
|
| 167 |
+
hide_columns=[],
|
| 168 |
+
bool_checkboxgroup_label="Hide models",
|
| 169 |
+
interactive=False,
|
| 170 |
+
)
|
| 171 |
+
|
| 172 |
|
| 173 |
def init_leaderboard(dataframe, track):
|
| 174 |
if dataframe is None or dataframe.empty:
|
src/display/utils.py
CHANGED
|
@@ -208,19 +208,37 @@ BENCHMARK_COLS_MIB_CAUSALGRAPH = []
|
|
| 208 |
# ColumnContent(col_name, "number", True)
|
| 209 |
# ])
|
| 210 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 211 |
auto_eval_column_dict_mib_causalgraph = []
|
| 212 |
|
| 213 |
-
# Method
|
| 214 |
auto_eval_column_dict_mib_causalgraph.append(["method", ColumnContent, ColumnContent("Method", "markdown", True, never_hidden=True)])
|
| 215 |
-
auto_eval_column_dict_mib_causalgraph.append(["eval_name", ColumnContent, ColumnContent("eval_name", "str", True)])
|
| 216 |
|
| 217 |
# For each model-task-intervention-counterfactual combination
|
| 218 |
for task in TasksMib_Causalgraph:
|
| 219 |
-
for model in task.value.models: # model will
|
| 220 |
for layer in task.value.layers[model]:
|
| 221 |
for intervention in task.value.interventions:
|
| 222 |
for counterfactual in task.value.counterfactuals:
|
| 223 |
-
# Use exactly the same format as in DataFrame
|
| 224 |
col_name = f"{model}_layer{layer}_{intervention}_{counterfactual}"
|
| 225 |
auto_eval_column_dict_mib_causalgraph.append([
|
| 226 |
col_name,
|
|
|
|
| 208 |
# ColumnContent(col_name, "number", True)
|
| 209 |
# ])
|
| 210 |
|
| 211 |
+
# auto_eval_column_dict_mib_causalgraph = []
|
| 212 |
+
|
| 213 |
+
# # Method name column
|
| 214 |
+
# auto_eval_column_dict_mib_causalgraph.append(["method", ColumnContent, ColumnContent("Method", "markdown", True, never_hidden=True)])
|
| 215 |
+
# auto_eval_column_dict_mib_causalgraph.append(["eval_name", ColumnContent, ColumnContent("eval_name", "str", True)])
|
| 216 |
+
|
| 217 |
+
# # For each model-task-intervention-counterfactual combination
|
| 218 |
+
# for task in TasksMib_Causalgraph:
|
| 219 |
+
# for model in task.value.models: # model will already be lowercase
|
| 220 |
+
# for layer in task.value.layers[model]:
|
| 221 |
+
# for intervention in task.value.interventions:
|
| 222 |
+
# for counterfactual in task.value.counterfactuals:
|
| 223 |
+
# # Use exactly the same format as in DataFrame
|
| 224 |
+
# col_name = f"{model}_layer{layer}_{intervention}_{counterfactual}"
|
| 225 |
+
# auto_eval_column_dict_mib_causalgraph.append([
|
| 226 |
+
# col_name,
|
| 227 |
+
# ColumnContent,
|
| 228 |
+
# ColumnContent(col_name, "number", True)
|
| 229 |
+
# ])
|
| 230 |
+
|
| 231 |
auto_eval_column_dict_mib_causalgraph = []
|
| 232 |
|
| 233 |
+
# Only include Method column as required
|
| 234 |
auto_eval_column_dict_mib_causalgraph.append(["method", ColumnContent, ColumnContent("Method", "markdown", True, never_hidden=True)])
|
|
|
|
| 235 |
|
| 236 |
# For each model-task-intervention-counterfactual combination
|
| 237 |
for task in TasksMib_Causalgraph:
|
| 238 |
+
for model in task.value.models: # model will be lowercase
|
| 239 |
for layer in task.value.layers[model]:
|
| 240 |
for intervention in task.value.interventions:
|
| 241 |
for counterfactual in task.value.counterfactuals:
|
|
|
|
| 242 |
col_name = f"{model}_layer{layer}_{intervention}_{counterfactual}"
|
| 243 |
auto_eval_column_dict_mib_causalgraph.append([
|
| 244 |
col_name,
|