Spaces:
Sleeping
Sleeping
zhenwu0831 commited on
Commit Β·
0d12b5d
1
Parent(s): b1901c7
v18
Browse files
app.py
CHANGED
|
@@ -414,7 +414,7 @@ def compute_total_score(
|
|
| 414 |
def process_submission(file):
|
| 415 |
try:
|
| 416 |
if file is None:
|
| 417 |
-
return "β Please upload a submission JSON file."
|
| 418 |
|
| 419 |
path = file if isinstance(file, str) else file.name
|
| 420 |
with open(path, "r", encoding="utf-8") as f:
|
|
@@ -430,7 +430,7 @@ def process_submission(file):
|
|
| 430 |
if used >= MAX_ATTEMPTS:
|
| 431 |
return (
|
| 432 |
f"β Submission rejected: {andrewid} has already used {used}/{MAX_ATTEMPTS} attempts.",
|
| 433 |
-
|
| 434 |
)
|
| 435 |
|
| 436 |
gold_map = load_gold_map()
|
|
@@ -440,7 +440,7 @@ def process_submission(file):
|
|
| 440 |
return (
|
| 441 |
f"β Submission rejected: Expected {len(gold_map)} answers, but got {len(user_answers)}. "
|
| 442 |
f"Your submission must contain answers for all questions in the gold dataset.",
|
| 443 |
-
|
| 444 |
)
|
| 445 |
|
| 446 |
# Validate that all question IDs in submission exist in gold
|
|
@@ -552,10 +552,10 @@ def process_submission(file):
|
|
| 552 |
else:
|
| 553 |
lines.append(f"LLM judge: {avg_judge:.3f} (1-5)")
|
| 554 |
|
| 555 |
-
return "\n".join(lines)
|
| 556 |
|
| 557 |
except Exception as e:
|
| 558 |
-
return f"β Error: {e}"
|
| 559 |
|
| 560 |
|
| 561 |
# =========================
|
|
|
|
| 414 |
def process_submission(file):
|
| 415 |
try:
|
| 416 |
if file is None:
|
| 417 |
+
return "β Please upload a submission JSON file.", get_leaderboard_display()
|
| 418 |
|
| 419 |
path = file if isinstance(file, str) else file.name
|
| 420 |
with open(path, "r", encoding="utf-8") as f:
|
|
|
|
| 430 |
if used >= MAX_ATTEMPTS:
|
| 431 |
return (
|
| 432 |
f"β Submission rejected: {andrewid} has already used {used}/{MAX_ATTEMPTS} attempts.",
|
| 433 |
+
get_leaderboard_display(),
|
| 434 |
)
|
| 435 |
|
| 436 |
gold_map = load_gold_map()
|
|
|
|
| 440 |
return (
|
| 441 |
f"β Submission rejected: Expected {len(gold_map)} answers, but got {len(user_answers)}. "
|
| 442 |
f"Your submission must contain answers for all questions in the gold dataset.",
|
| 443 |
+
get_leaderboard_display(),
|
| 444 |
)
|
| 445 |
|
| 446 |
# Validate that all question IDs in submission exist in gold
|
|
|
|
| 552 |
else:
|
| 553 |
lines.append(f"LLM judge: {avg_judge:.3f} (1-5)")
|
| 554 |
|
| 555 |
+
return "\n".join(lines), get_leaderboard_display()
|
| 556 |
|
| 557 |
except Exception as e:
|
| 558 |
+
return f"β Error: {e}", get_leaderboard_display()
|
| 559 |
|
| 560 |
|
| 561 |
# =========================
|