Update app.py
Browse files
app.py
CHANGED
|
@@ -31,7 +31,7 @@ from openinference.instrumentation.smolagents import SmolagentsInstrumentor
|
|
| 31 |
SmolagentsInstrumentor().instrument()
|
| 32 |
|
| 33 |
# Importing the Agent stuff
|
| 34 |
-
from smolagents import CodeAgent,DuckDuckGoSearchTool, InferenceClientModel, PromptTemplates, EMPTY_PROMPT_TEMPLATES
|
| 35 |
from tools.final_answer import FinalAnswerTool
|
| 36 |
import yaml
|
| 37 |
|
|
@@ -43,11 +43,12 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
| 43 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 44 |
class BasicAgent:
|
| 45 |
def __init__(self):
|
| 46 |
-
final_answer = FinalAnswerTool()
|
| 47 |
-
|
| 48 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 49 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 50 |
-
model = InferenceClientModel(
|
|
|
|
|
|
|
|
|
|
| 51 |
print(os.getenv('HF_Token'))
|
| 52 |
|
| 53 |
with open("prompts.yaml", 'r') as stream:
|
|
@@ -59,7 +60,7 @@ class BasicAgent:
|
|
| 59 |
|
| 60 |
self.agent = CodeAgent(
|
| 61 |
model=model,
|
| 62 |
-
tools=[
|
| 63 |
additional_authorized_imports=['pandas'],
|
| 64 |
max_steps=6,
|
| 65 |
verbosity_level=1
|
|
|
|
| 31 |
SmolagentsInstrumentor().instrument()
|
| 32 |
|
| 33 |
# Importing the Agent stuff
|
| 34 |
+
from smolagents import CodeAgent,DuckDuckGoSearchTool,GoogleSearchTool,VisitWebPageTool, InferenceClientModel, PromptTemplates, EMPTY_PROMPT_TEMPLATES
|
| 35 |
from tools.final_answer import FinalAnswerTool
|
| 36 |
import yaml
|
| 37 |
|
|
|
|
| 43 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
| 44 |
class BasicAgent:
|
| 45 |
def __init__(self):
|
|
|
|
|
|
|
| 46 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
| 47 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
| 48 |
+
model = InferenceClientModel(
|
| 49 |
+
model_id='mistralai/Mistral-Small-3.2-24B-Instruct-2506',
|
| 50 |
+
token=os.getenv('HF_Token'))
|
| 51 |
+
|
| 52 |
print(os.getenv('HF_Token'))
|
| 53 |
|
| 54 |
with open("prompts.yaml", 'r') as stream:
|
|
|
|
| 60 |
|
| 61 |
self.agent = CodeAgent(
|
| 62 |
model=model,
|
| 63 |
+
tools=[FinalAnswerTool(), GoogleSearchTool(), VisitWebPageTool()], ## add your tools here (don't remove final answer),
|
| 64 |
additional_authorized_imports=['pandas'],
|
| 65 |
max_steps=6,
|
| 66 |
verbosity_level=1
|