Spaces:
No application file
No application file
Upload 4 files
Browse files- README.md +17 -13
- evaluate.py +38 -0
- gaia-agent.zip +3 -0
- requirements.txt +3 -0
README.md
CHANGED
@@ -1,13 +1,17 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
# Agente GAIA para Hugging Face Spaces
|
3 |
+
|
4 |
+
Este proyecto contiene:
|
5 |
+
- Un agente simple listo para subir a un Space de Hugging Face.
|
6 |
+
- Un script Python (`evaluate.py`) para interactuar con el API de evaluaci贸n de GAIA.
|
7 |
+
|
8 |
+
## Requisitos
|
9 |
+
- Python 3.8+
|
10 |
+
- Clave de API de OpenAI (si usas un modelo real)
|
11 |
+
- Tener un Space p煤blico en Hugging Face
|
12 |
+
|
13 |
+
## C贸mo probar
|
14 |
+
1. Sube el contenido de esta carpeta a tu Hugging Face Space.
|
15 |
+
2. Ejecuta el Space y prueba manualmente.
|
16 |
+
3. Ajusta el script `evaluate.py` con los datos reales (API URL, tu Space, etc.).
|
17 |
+
4. Ejecuta el script para obtener las preguntas y enviar tus respuestas.
|
evaluate.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
import requests
|
3 |
+
|
4 |
+
# CONFIGURA TUS DATOS AQU脥
|
5 |
+
API_URL = "https://<API_DE_EVALUACION>/questions"
|
6 |
+
SUBMIT_URL = "https://<API_DE_EVALUACION>/submit"
|
7 |
+
SPACE_URL = "https://huggingface.co/spaces/<TU_USUARIO>/<NOMBRE_DEL_SPACE>/tree/main"
|
8 |
+
USERNAME = "<TU_USUARIO>"
|
9 |
+
|
10 |
+
# Obtener las preguntas
|
11 |
+
response = requests.get(API_URL)
|
12 |
+
questions = response.json()
|
13 |
+
|
14 |
+
answers = []
|
15 |
+
|
16 |
+
for q in questions:
|
17 |
+
task_id = q["task_id"]
|
18 |
+
task_data = q["question"]
|
19 |
+
|
20 |
+
# Llamada al agente
|
21 |
+
agent_response = requests.post(
|
22 |
+
"<URL_DEL_SPACE>/predict",
|
23 |
+
json={"task_id": task_id, "task_data": task_data}
|
24 |
+
)
|
25 |
+
|
26 |
+
submitted_answer = agent_response.json()["submitted_answer"]
|
27 |
+
|
28 |
+
answers.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
29 |
+
|
30 |
+
# Enviar respuestas
|
31 |
+
payload = {
|
32 |
+
"username": USERNAME,
|
33 |
+
"agent_code": SPACE_URL,
|
34 |
+
"answers": answers
|
35 |
+
}
|
36 |
+
|
37 |
+
submit_response = requests.post(SUBMIT_URL, json=payload)
|
38 |
+
print(submit_response.json())
|
gaia-agent.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:40dc1edda40544f8375ad1e6f36c772a075cc5c32602e939155934577203ba7f
|
3 |
+
size 2862
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
|
2 |
+
gradio
|
3 |
+
requests
|