Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
-
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, VisitWebpageTool, load_tool, tool
|
| 7 |
import yaml
|
| 8 |
from tools.final_answer import FinalAnswerTool
|
| 9 |
|
|
@@ -44,15 +44,22 @@ def run_and_submit_all( profile: gr.OAuthProfile | None):
|
|
| 44 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 45 |
try:
|
| 46 |
|
| 47 |
-
agent = CodeAgent(
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
|
| 57 |
#agent = BasicAgent()
|
| 58 |
except Exception as e:
|
|
|
|
| 3 |
import requests
|
| 4 |
import inspect
|
| 5 |
import pandas as pd
|
| 6 |
+
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel, VisitWebpageTool, InferenceClientModel, load_tool, tool
|
| 7 |
import yaml
|
| 8 |
from tools.final_answer import FinalAnswerTool
|
| 9 |
|
|
|
|
| 44 |
# 1. Instantiate Agent ( modify this part to create your agent)
|
| 45 |
try:
|
| 46 |
|
| 47 |
+
#agent = CodeAgent(
|
| 48 |
+
# tools=[
|
| 49 |
+
# DuckDuckGoSearchTool(),
|
| 50 |
+
# VisitWebpageTool()
|
| 51 |
+
# ],
|
| 52 |
+
# model=HfApiModel(),
|
| 53 |
+
# max_steps=10,
|
| 54 |
+
# verbosity_level=2
|
| 55 |
+
#)
|
| 56 |
+
|
| 57 |
+
model_id = "meta-llama/Llama-3.3-70B-Instruct"
|
| 58 |
+
|
| 59 |
+
#model = InferenceClientModel(model_id=model_id, token="<YOUR_HUGGINGFACEHUB_API_TOKEN>") # You can choose to not pass any model_id to InferenceClientModel to use a default model
|
| 60 |
+
model = InferenceClientModel()
|
| 61 |
+
# you can also specify a particular provider e.g. provider="together" or provider="sambanova"
|
| 62 |
+
agent = CodeAgent(tools=[], model=model, add_base_tools=True)
|
| 63 |
|
| 64 |
#agent = BasicAgent()
|
| 65 |
except Exception as e:
|