mabelwang21 commited on
Commit
b1d7643
·
1 Parent(s): a349bf1

update HfApiModel with token

Browse files
Files changed (1) hide show
  1. agent.py +2 -2
agent.py CHANGED
@@ -101,13 +101,13 @@ def calculate(expr: str) -> float:
101
  # -------------------- AGENT CLASS --------------------
102
 
103
  tools = [web_search, wikipedia_search, image_recognition, read_pdf, calculate]
104
-
105
  class MyAgent:
106
  def __init__(self):
107
  from smolagents import HfApiModel
108
  self.agent = ToolCallingAgent(
109
  tools=tools,
110
- model=HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct") # or another supported model
111
  )
112
 
113
  def __call__(self, question: str) -> str:
 
101
  # -------------------- AGENT CLASS --------------------
102
 
103
  tools = [web_search, wikipedia_search, image_recognition, read_pdf, calculate]
104
+ HF_TOKEN = os.getenv("HF_API_TOKEN")
105
  class MyAgent:
106
  def __init__(self):
107
  from smolagents import HfApiModel
108
  self.agent = ToolCallingAgent(
109
  tools=tools,
110
+ model=HfApiModel("Qwen/Qwen2.5-Coder-32B-Instruct", token=HF_TOKEN) # or another supported model
111
  )
112
 
113
  def __call__(self, question: str) -> str: