Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,6 +7,7 @@ from smolagents import LiteLLMModel
|
|
| 7 |
from smolagents import CodeAgent, ToolCallingAgent, GoogleSearchTool, HfApiModel, VisitWebpageTool, DuckDuckGoSearchTool, tool, PythonInterpreterTool, WikipediaSearchTool
|
| 8 |
import requests
|
| 9 |
from youtube_transcript_api import YouTubeTranscriptApi
|
|
|
|
| 10 |
|
| 11 |
# (Keep Constants as is)
|
| 12 |
# --- Constants ---
|
|
@@ -146,6 +147,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 146 |
submitted_answer = agent(question_text)
|
| 147 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 148 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
|
|
|
| 149 |
except Exception as e:
|
| 150 |
print(f"Error running agent on task {task_id}: {e}")
|
| 151 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|
|
|
|
| 7 |
from smolagents import CodeAgent, ToolCallingAgent, GoogleSearchTool, HfApiModel, VisitWebpageTool, DuckDuckGoSearchTool, tool, PythonInterpreterTool, WikipediaSearchTool
|
| 8 |
import requests
|
| 9 |
from youtube_transcript_api import YouTubeTranscriptApi
|
| 10 |
+
import time
|
| 11 |
|
| 12 |
# (Keep Constants as is)
|
| 13 |
# --- Constants ---
|
|
|
|
| 147 |
submitted_answer = agent(question_text)
|
| 148 |
answers_payload.append({"task_id": task_id, "submitted_answer": submitted_answer})
|
| 149 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": submitted_answer})
|
| 150 |
+
time.sleep(120)
|
| 151 |
except Exception as e:
|
| 152 |
print(f"Error running agent on task {task_id}: {e}")
|
| 153 |
results_log.append({"Task ID": task_id, "Question": question_text, "Submitted Answer": f"AGENT ERROR: {e}"})
|