MARIAEUGENIA88 commited on
Commit
fc966f0
·
verified ·
1 Parent(s): 2a64efd

Delete evaluate.py

Browse files
Files changed (1) hide show
  1. evaluate.py +0 -38
evaluate.py DELETED
@@ -1,38 +0,0 @@
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())