Spaces:
Running
Running
jasonshaoshun
commited on
Commit
·
1eaca05
1
Parent(s):
924fb19
debug
Browse files- src/about.py +19 -4
- src/display/utils.py +22 -2
src/about.py
CHANGED
|
@@ -102,14 +102,29 @@ class TaskMIB_Causalgraph:
|
|
| 102 |
counterfactuals: list[str]
|
| 103 |
metrics: list[str]
|
| 104 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 105 |
class TasksMib_Causalgraph(Enum):
|
| 106 |
task0 = TaskMIB_Causalgraph(
|
| 107 |
"MCQA",
|
| 108 |
-
["
|
| 109 |
{
|
| 110 |
-
"
|
| 111 |
-
"
|
| 112 |
-
"
|
| 113 |
},
|
| 114 |
"mcqa",
|
| 115 |
["output_token", "output_location"],
|
|
|
|
| 102 |
counterfactuals: list[str]
|
| 103 |
metrics: list[str]
|
| 104 |
|
| 105 |
+
# class TasksMib_Causalgraph(Enum):
|
| 106 |
+
# task0 = TaskMIB_Causalgraph(
|
| 107 |
+
# "MCQA",
|
| 108 |
+
# ["Qwen2ForCausalLM", "Gemma2ForCausalLM", "LlamaForCausalLM"],
|
| 109 |
+
# {
|
| 110 |
+
# "Qwen2ForCausalLM": [str(i) for i in range(24)], # 0-23
|
| 111 |
+
# "Gemma2ForCausalLM": [str(i) for i in range(26)], # 0-25
|
| 112 |
+
# "LlamaForCausalLM": [str(i) for i in range(32)] # 0-31
|
| 113 |
+
# },
|
| 114 |
+
# "mcqa",
|
| 115 |
+
# ["output_token", "output_location"],
|
| 116 |
+
# ["randomLetter_counterfactual", "answerPosition_counterfactual",
|
| 117 |
+
# "answerPosition_randomLetter_counterfactual"],
|
| 118 |
+
# ["score"]
|
| 119 |
+
# )
|
| 120 |
class TasksMib_Causalgraph(Enum):
|
| 121 |
task0 = TaskMIB_Causalgraph(
|
| 122 |
"MCQA",
|
| 123 |
+
["qwen2forcausallm", "gemma2forcausallm", "llamaforcausallm"], # Use lowercase names to match actual columns
|
| 124 |
{
|
| 125 |
+
"qwen2forcausallm": [str(i) for i in range(24)], # 0-23
|
| 126 |
+
"gemma2forcausallm": [str(i) for i in range(26)], # 0-25
|
| 127 |
+
"llamaforcausallm": [str(i) for i in range(32)] # 0-31
|
| 128 |
},
|
| 129 |
"mcqa",
|
| 130 |
["output_token", "output_location"],
|
src/display/utils.py
CHANGED
|
@@ -189,6 +189,25 @@ BENCHMARK_COLS_MIB_CAUSALGRAPH = []
|
|
| 189 |
|
| 190 |
|
| 191 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
auto_eval_column_dict_mib_causalgraph = []
|
| 193 |
|
| 194 |
# Method name column
|
|
@@ -197,10 +216,11 @@ auto_eval_column_dict_mib_causalgraph.append(["eval_name", ColumnContent, Column
|
|
| 197 |
|
| 198 |
# For each model-task-intervention-counterfactual combination
|
| 199 |
for task in TasksMib_Causalgraph:
|
| 200 |
-
for model in task.value.models:
|
| 201 |
-
for layer in task.value.layers[model]:
|
| 202 |
for intervention in task.value.interventions:
|
| 203 |
for counterfactual in task.value.counterfactuals:
|
|
|
|
| 204 |
col_name = f"{model}_layer{layer}_{intervention}_{counterfactual}"
|
| 205 |
auto_eval_column_dict_mib_causalgraph.append([
|
| 206 |
col_name,
|
|
|
|
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
+
# auto_eval_column_dict_mib_causalgraph = []
|
| 193 |
+
|
| 194 |
+
# # Method name column
|
| 195 |
+
# auto_eval_column_dict_mib_causalgraph.append(["method", ColumnContent, ColumnContent("Method", "markdown", True, never_hidden=True)])
|
| 196 |
+
# auto_eval_column_dict_mib_causalgraph.append(["eval_name", ColumnContent, ColumnContent("eval_name", "str", True)])
|
| 197 |
+
|
| 198 |
+
# # For each model-task-intervention-counterfactual combination
|
| 199 |
+
# for task in TasksMib_Causalgraph:
|
| 200 |
+
# for model in task.value.models:
|
| 201 |
+
# for layer in task.value.layers[model]: # Use model-specific layers
|
| 202 |
+
# for intervention in task.value.interventions:
|
| 203 |
+
# for counterfactual in task.value.counterfactuals:
|
| 204 |
+
# col_name = f"{model}_layer{layer}_{intervention}_{counterfactual}"
|
| 205 |
+
# auto_eval_column_dict_mib_causalgraph.append([
|
| 206 |
+
# col_name,
|
| 207 |
+
# ColumnContent,
|
| 208 |
+
# ColumnContent(col_name, "number", True)
|
| 209 |
+
# ])
|
| 210 |
+
|
| 211 |
auto_eval_column_dict_mib_causalgraph = []
|
| 212 |
|
| 213 |
# Method name column
|
|
|
|
| 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,
|