more tools
Browse files
app.py
CHANGED
|
@@ -3,6 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
|
|
|
| 6 |
|
| 7 |
from agent import MyAgent
|
| 8 |
|
|
@@ -78,7 +79,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 78 |
except Exception as e:
|
| 79 |
print(f"Error running agent on task {task_id}: {e}")
|
| 80 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
| 81 |
-
|
| 82 |
if not answers_payload:
|
| 83 |
print("Agent did not produce any answers to submit.")
|
| 84 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
import time
|
| 7 |
|
| 8 |
from agent import MyAgent
|
| 9 |
|
|
|
|
| 79 |
except Exception as e:
|
| 80 |
print(f"Error running agent on task {task_id}: {e}")
|
| 81 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
| 82 |
+
time.sleep(30) # Delay to avoid rate limiting or server overload
|
| 83 |
if not answers_payload:
|
| 84 |
print("Agent did not produce any answers to submit.")
|
| 85 |
return "Agent did not produce any answers to submit.", pd.DataFrame(results_log)
|