Update app.py
Browse files
app.py
CHANGED
|
@@ -160,12 +160,18 @@ def add_new_eval(
|
|
| 160 |
raise format_error(f"Line {ix} contains no final_answer key. Please fix it and resubmit your file.")
|
| 161 |
answer = task["final_answer"]
|
| 162 |
task_name = task["task_name"]
|
| 163 |
-
|
|
|
|
| 164 |
level = int(gold_results[val_or_test][task_name]["Level"])
|
| 165 |
score = question_scorer(task, gold_results[val_or_test][task_name])
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 169 |
|
| 170 |
scored_file.write(
|
| 171 |
json.dumps({
|
|
|
|
| 160 |
raise format_error(f"Line {ix} contains no final_answer key. Please fix it and resubmit your file.")
|
| 161 |
answer = task["final_answer"]
|
| 162 |
task_name = task["task_name"]
|
| 163 |
+
|
| 164 |
+
if task_name in gold_results[val_or_test]:
|
| 165 |
level = int(gold_results[val_or_test][task_name]["Level"])
|
| 166 |
score = question_scorer(task, gold_results[val_or_test][task_name])
|
| 167 |
+
else:
|
| 168 |
+
continue
|
| 169 |
+
# try:
|
| 170 |
+
# level = int(gold_results[val_or_test][task_name]["Level"])
|
| 171 |
+
# score = question_scorer(task, gold_results[val_or_test][task_name])
|
| 172 |
+
# except KeyError:
|
| 173 |
+
# return format_error(
|
| 174 |
+
# f"{task_name} not found in split {val_or_test}. Are you sure you submitted the correct file?")
|
| 175 |
|
| 176 |
scored_file.write(
|
| 177 |
json.dumps({
|