Spaces:
Sleeping
Sleeping
File size: 665 Bytes
c8d3d3e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import requests
from agent import answer_question
# Get GAIA questions
questions = requests.get("https://api.gaia-course.com/questions").json()
# Format answers
answers = []
for q in questions:
task_id = q["task_id"]
question = q["question"]
response = answer_question(question)
answers.append({"task_id": task_id, "submitted_answer": response.strip()})
# Submit answers
submission = {
"username": "your-hf-username",
"agent_code": "https://huggingface.co/spaces/yourname/your-space/tree/main",
"answers": answers
}
submit_response = requests.post("https://api.gaia-course.com/submit", json=submission)
print(submit_response.json())
|