yangminded commited on
Commit
a5101bb
·
verified ·
1 Parent(s): 225320c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
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(token=os.getenv('HF_Token'))
 
 
 
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=[final_answer, DuckDuckGoSearchTool()], ## add your tools here (don't remove final answer),
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