Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +3,15 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# (Keep Constants as is)
|
| 8 |
# --- Constants ---
|
|
@@ -40,7 +49,7 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 40 |
|
| 41 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 42 |
try:
|
| 43 |
-
agent = BasicAgent()
|
| 44 |
except Exception as e:
|
| 45 |
print(f"Error instantiating agent: {e}")
|
| 46 |
return f"Error initializing agent: {e}", None
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from smolagents import DuckDuckGoSearchTool, VisitWebpageTool
|
| 7 |
+
|
| 8 |
+
model = HfApiModel(
|
| 9 |
+
max_tokens=2096,
|
| 10 |
+
temperature=0.5,
|
| 11 |
+
#model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded
|
| 12 |
+
model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud',
|
| 13 |
+
custom_role_conversions=None,
|
| 14 |
+
)
|
| 15 |
|
| 16 |
# (Keep Constants as is)
|
| 17 |
# --- Constants ---
|
|
|
|
| 49 |
|
| 50 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 51 |
try:
|
| 52 |
+
agent = BasicAgent(tools=[search_tool, get_latest_news], model=model)
|
| 53 |
except Exception as e:
|
| 54 |
print(f"Error instantiating agent: {e}")
|
| 55 |
return f"Error initializing agent: {e}", None
|