Youssef-El-SaYed commited on
Commit
c017965
·
verified ·
1 Parent(s): aafb854

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -3,7 +3,7 @@ import gradio as gr
3
  import requests
4
  import inspect
5
  import pandas as pd
6
- from smolagents import CodeAgent, DuckDuckGoSearchTool
7
 
8
  # (Keep Constants as is)
9
  # --- Constants ---
@@ -15,14 +15,17 @@ class BasicAgent:
15
  def __init__(self):
16
  print("Initializing Smolagents-based BasicAgent...")
17
 
18
- hf_token = os.getenv("HF_TOKEN")
19
-
20
  # Create the tools the agent can use
21
  self.search_tool = DuckDuckGoSearchTool()
22
 
 
 
 
 
 
23
  # Create a reasoning agent that can call tools
24
  self.agent = CodeAgent(
25
- model="HuggingFaceH4/zephyr-7b-alpha",
26
  tools=[self.search_tool],
27
  max_steps=6,
28
  )
 
3
  import requests
4
  import inspect
5
  import pandas as pd
6
+ from smolagents import CodeAgent, DuckDuckGoSearchTool , HfApiModel
7
 
8
  # (Keep Constants as is)
9
  # --- Constants ---
 
15
  def __init__(self):
16
  print("Initializing Smolagents-based BasicAgent...")
17
 
 
 
18
  # Create the tools the agent can use
19
  self.search_tool = DuckDuckGoSearchTool()
20
 
21
+ self.model = HfApiModel(
22
+ model_id= "google/gemma-2b-it",
23
+ token=os.getenv("HF_TOKEN")
24
+ )
25
+
26
  # Create a reasoning agent that can call tools
27
  self.agent = CodeAgent(
28
+ model=self.model,
29
  tools=[self.search_tool],
30
  max_steps=6,
31
  )