Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,8 @@ import requests
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
|
|
|
|
7 |
|
8 |
|
9 |
# (Keep Constants as is)
|
@@ -56,7 +58,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
56 |
|
57 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
58 |
try:
|
59 |
-
agent =
|
60 |
except Exception as e:
|
61 |
print(f"Error instantiating agent: {e}")
|
62 |
return f"Error initializing agent: {e}", None
|
@@ -187,11 +189,6 @@ with gr.Blocks() as demo:
|
|
187 |
outputs=[status_output, results_table]
|
188 |
)
|
189 |
|
190 |
-
run_button.click(
|
191 |
-
fn=run_and_submit_all,
|
192 |
-
outputs=[status_output, results_table]
|
193 |
-
)
|
194 |
-
|
195 |
if __name__ == "__main__":
|
196 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
197 |
# Check for SPACE_HOST and SPACE_ID at startup for information
|
|
|
4 |
import inspect
|
5 |
import pandas as pd
|
6 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
7 |
+
from agent import DuckDuckGoAgent
|
8 |
+
|
9 |
|
10 |
|
11 |
# (Keep Constants as is)
|
|
|
58 |
|
59 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
60 |
try:
|
61 |
+
agent = DuckDuckGoAgent()
|
62 |
except Exception as e:
|
63 |
print(f"Error instantiating agent: {e}")
|
64 |
return f"Error initializing agent: {e}", None
|
|
|
189 |
outputs=[status_output, results_table]
|
190 |
)
|
191 |
|
|
|
|
|
|
|
|
|
|
|
192 |
if __name__ == "__main__":
|
193 |
print("\n" + "-"*30 + " App Starting " + "-"*30)
|
194 |
# Check for SPACE_HOST and SPACE_ID at startup for information
|