Iamvincent commited on
Commit
d906d04
·
verified ·
1 Parent(s): 86ba500

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -15,7 +15,14 @@ class BasicAgent:
15
  def __init__(self):
16
  print("BasicAgent initialized.")
17
 
18
- self.agent = CodeAgent(tools=[DuckDuckGoSearchTool()], model=HfApiModel())
 
 
 
 
 
 
 
19
 
20
  def __call__(self, question: str) -> str:
21
  print(f"Agent received question (first 50 chars): {question[:50]}...")
 
15
  def __init__(self):
16
  print("BasicAgent initialized.")
17
 
18
+ hf_token = os.getenv("HF_TOKEN")
19
+ if not hf_token:
20
+ raise ValueError("HF_TOKEN environment variable is not set.")
21
+
22
+ self.agent = CodeAgent(
23
+ tools=[DuckDuckGoSearchTool()],
24
+ model=HfApiModel(token=hf_token, model="microsoft/phi-2")
25
+ )
26
 
27
  def __call__(self, question: str) -> str:
28
  print(f"Agent received question (first 50 chars): {question[:50]}...")