Johnsonin commited on
Commit
ea86e09
·
verified ·
1 Parent(s): 4dada8a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -6,6 +6,9 @@ import pandas as pd
6
  from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool, InferenceClientModel, Tool, tool, VisitWebpageTool
7
  from huggingface_hub import login, InferenceClient
8
 
 
 
 
9
  # (Keep Constants as is)
10
  # --- Constants ---
11
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
@@ -19,9 +22,9 @@ class BasicAgent:
19
  DuckDuckGoSearchTool(),
20
  VisitWebpageTool()
21
  ],
22
- model=InferenceClientModel(),
23
- #max_steps=10,
24
- #verbosity_level=2
25
  )
26
  def __call__(self, question: str) -> str:
27
  return self.agent.run(question)
 
6
  from smolagents import CodeAgent, DuckDuckGoSearchTool, FinalAnswerTool, InferenceClientModel, Tool, tool, VisitWebpageTool
7
  from huggingface_hub import login, InferenceClient
8
 
9
+
10
+ hf_token = os.environ.get('HF_token')
11
+
12
  # (Keep Constants as is)
13
  # --- Constants ---
14
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
22
  DuckDuckGoSearchTool(),
23
  VisitWebpageTool()
24
  ],
25
+ model=InferenceClientModel(token=hf_token),
26
+ max_steps=10,
27
+ verbosity_level=2
28
  )
29
  def __call__(self, question: str) -> str:
30
  return self.agent.run(question)