Spaces:
Sleeping
Sleeping
Add more debug logs
Browse files
app.py
CHANGED
@@ -72,7 +72,6 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
72 |
|
73 |
print(questions_url, submit_url)
|
74 |
print(username, space_id, os.getenv("GEMINI_API_KEY"), 'keys')
|
75 |
-
return 'Logged'
|
76 |
|
77 |
try:
|
78 |
agent = MyAgent()
|
@@ -89,6 +88,8 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
89 |
results_log = []
|
90 |
answers_payload = []
|
91 |
|
|
|
|
|
92 |
for item in questions_data:
|
93 |
task_id = item.get("task_id")
|
94 |
question_text = item.get("question")
|
@@ -96,6 +97,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
96 |
continue
|
97 |
try:
|
98 |
submitted_answer = agent(question_text)
|
|
|
99 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
100 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
101 |
except Exception as e:
|
@@ -105,6 +107,8 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
105 |
"Submitted Answer": f"AGENT ERROR: {e}"
|
106 |
})
|
107 |
|
|
|
|
|
108 |
if not answers_payload:
|
109 |
return "Agent did not return any answers.", pd.DataFrame(results_log)
|
110 |
|
|
|
72 |
|
73 |
print(questions_url, submit_url)
|
74 |
print(username, space_id, os.getenv("GEMINI_API_KEY"), 'keys')
|
|
|
75 |
|
76 |
try:
|
77 |
agent = MyAgent()
|
|
|
88 |
results_log = []
|
89 |
answers_payload = []
|
90 |
|
91 |
+
print(questions_data, 'qd')
|
92 |
+
|
93 |
for item in questions_data:
|
94 |
task_id = item.get("task_id")
|
95 |
question_text = item.get("question")
|
|
|
97 |
continue
|
98 |
try:
|
99 |
submitted_answer = agent(question_text)
|
100 |
+
print(submitted_answer, 'answered!!!!')
|
101 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
102 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
103 |
except Exception as e:
|
|
|
107 |
"Submitted Answer": f"AGENT ERROR: {e}"
|
108 |
})
|
109 |
|
110 |
+
print(answers_payload, 'answers####')
|
111 |
+
|
112 |
if not answers_payload:
|
113 |
return "Agent did not return any answers.", pd.DataFrame(results_log)
|
114 |
|