Spaces:
Sleeping
Sleeping
| from questions import get_all_questions | |
| from gaia_interface import submit_to_leaderboard | |
| def run_and_submit_all(agent): | |
| print("β [Checkpoint 1] Loading questions...") | |
| try: | |
| questions = get_all_questions() | |
| except Exception as e: | |
| return f"β Failed to load questions: {e}" | |
| print(f"β [Checkpoint 2] Loaded {len(questions)} questions.") | |
| answers = [] | |
| for i, q in enumerate(questions): | |
| print(f"β‘οΈ [Checkpoint 3.{i}] Processing question ID: {q.get('id', 'UNKNOWN')}") | |
| try: | |
| answer = agent.answer_question(q) | |
| except Exception as e: | |
| return f"β Failed while answering question {q.get('id', 'UNKNOWN')}: {e}" | |
| answers.append({"question_id": q["id"], "answer": answer}) | |
| print("β [Checkpoint 4] All answers generated. Preparing submission...") | |
| try: | |
| result = submit_to_leaderboard(answers) | |
| print("β [Checkpoint 5] Submission succeeded.") | |
| return f"β Submission result:\n{result}" | |
| except Exception as e: | |
| return f"β Submission failed: {e}" |