kpalatel commited on
Commit
200e8a9
·
verified ·
1 Parent(s): 71de578

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +5 -6
agent.py CHANGED
@@ -1,5 +1,5 @@
1
  import os
2
- from smolagents import CodeAgent, HfApiModel, DuckDuckGoSearchTool, tool
3
 
4
  # Define a safety math helper because raw string math can confuse LLMs
5
  @tool
@@ -21,12 +21,11 @@ class CourseEvaluationAgent:
21
  def __init__(self):
22
  print("[Agent System] Booting Engine...")
23
 
24
- # 1. Initialize the correct API Model class
25
- # It automatically look for the HF_TOKEN secret configured in your Space settings
26
- self.model = HfApiModel("meta-llama/Llama-3.3-70B-Instruct")
27
 
28
- # 2. Build the functional CodeAgent
29
- # Using correct 'model=' parameter rather than legacy 'engine='
30
  self.agent = CodeAgent(
31
  tools=[DuckDuckGoSearchTool(), calculate_math],
32
  model=self.model,
 
1
  import os
2
+ from smolagents import CodeAgent, DuckDuckGoSearchTool, tool, ApiModel
3
 
4
  # Define a safety math helper because raw string math can confuse LLMs
5
  @tool
 
21
  def __init__(self):
22
  print("[Agent System] Booting Engine...")
23
 
24
+ # FIX: Swapped out HfApiModel for ApiModel to match your current package version.
25
+ # It automatically detects your HF_TOKEN secret behind the scenes.
26
+ self.model = ApiModel(model_id="meta-llama/Llama-3.3-70B-Instruct")
27
 
28
+ # Build the functional CodeAgent
 
29
  self.agent = CodeAgent(
30
  tools=[DuckDuckGoSearchTool(), calculate_math],
31
  model=self.model,