Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,7 @@ import pandas as pd
|
|
5 |
from huggingface_hub import login
|
6 |
from dotenv import load_dotenv
|
7 |
import time
|
|
|
8 |
|
9 |
# Cargar variables de entorno
|
10 |
load_dotenv()
|
@@ -33,7 +34,7 @@ def execute_agent_operations(profile: gr.OAuthProfile | None):
|
|
33 |
try:
|
34 |
print("Iniciando Agente...")
|
35 |
# Aquí puedes instanciar tu agente como se define en agent.py
|
36 |
-
|
37 |
except Exception as e:
|
38 |
print(f"Error al inicializar agente: {e}")
|
39 |
return f"Error al inicializar el agente: {e}", None
|
@@ -83,7 +84,7 @@ def execute_agent_operations(profile: gr.OAuthProfile | None):
|
|
83 |
print(f"Saltando tarea con información incompleta: {item}")
|
84 |
continue
|
85 |
try:
|
86 |
-
submitted_answer =
|
87 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
88 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
89 |
except Exception as e:
|
|
|
5 |
from huggingface_hub import login
|
6 |
from dotenv import load_dotenv
|
7 |
import time
|
8 |
+
from agent import Agente
|
9 |
|
10 |
# Cargar variables de entorno
|
11 |
load_dotenv()
|
|
|
34 |
try:
|
35 |
print("Iniciando Agente...")
|
36 |
# Aquí puedes instanciar tu agente como se define en agent.py
|
37 |
+
agente = Agente()
|
38 |
except Exception as e:
|
39 |
print(f"Error al inicializar agente: {e}")
|
40 |
return f"Error al inicializar el agente: {e}", None
|
|
|
84 |
print(f"Saltando tarea con información incompleta: {item}")
|
85 |
continue
|
86 |
try:
|
87 |
+
submitted_answer = agente.procesar_pregunta(question_text) # Aquí llamarías a tu agente para obtener la respuesta
|
88 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
89 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
90 |
except Exception as e:
|