Update app.py
Browse filesadd 100 retries and reduce timeout to 120 seconds
app.py
CHANGED
|
@@ -93,7 +93,7 @@ class EnhancedAgent:
|
|
| 93 |
def __init__(self):
|
| 94 |
self.model_id = "Qwen/Qwen3-235B-A22B-Thinking-2507"
|
| 95 |
self.provider = "auto"
|
| 96 |
-
self.timeout =
|
| 97 |
self.tools = [wiki_search, web_search, visit_webpage, read_file_as_text, reverse_string, final_answer]
|
| 98 |
self.auth_imports = ["pandas", "numpy", "datetime", "json", "re", "math", "os", "io", "requests", "csv", "urllib"]
|
| 99 |
self.max_steps = 10
|
|
@@ -182,10 +182,9 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 182 |
try:
|
| 183 |
answer = None
|
| 184 |
tries = 0
|
| 185 |
-
while (answer is None) and (tries <
|
| 186 |
maybe_answer = agent(question_text, file_name)
|
| 187 |
if maybe_answer.startswith("Error in generating final LLM output: 504 Server Error: Gateway Time-out for"):
|
| 188 |
-
answer = None
|
| 189 |
tries += 1
|
| 190 |
time.sleep(10)
|
| 191 |
else:
|
|
|
|
| 93 |
def __init__(self):
|
| 94 |
self.model_id = "Qwen/Qwen3-235B-A22B-Thinking-2507"
|
| 95 |
self.provider = "auto"
|
| 96 |
+
self.timeout = 120
|
| 97 |
self.tools = [wiki_search, web_search, visit_webpage, read_file_as_text, reverse_string, final_answer]
|
| 98 |
self.auth_imports = ["pandas", "numpy", "datetime", "json", "re", "math", "os", "io", "requests", "csv", "urllib"]
|
| 99 |
self.max_steps = 10
|
|
|
|
| 182 |
try:
|
| 183 |
answer = None
|
| 184 |
tries = 0
|
| 185 |
+
while (answer is None) and (tries < 100):
|
| 186 |
maybe_answer = agent(question_text, file_name)
|
| 187 |
if maybe_answer.startswith("Error in generating final LLM output: 504 Server Error: Gateway Time-out for"):
|
|
|
|
| 188 |
tries += 1
|
| 189 |
time.sleep(10)
|
| 190 |
else:
|