MeghanaNanuvala commited on
Commit
27ed756
·
verified ·
1 Parent(s): cf9696d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -1,27 +1,24 @@
1
  import gradio as gr
2
  from smolagents import CodeAgent, InferenceClientModel
3
- # from huggingface_hub import InferenceClient
4
-
5
- from tools import WeatherInfoTool, HubStatsTool
6
  from retriever import GuestRetrieverTool, docs
7
- from langchain_community.tools.ddg_search.tool import DuckDuckGoSearchTool
8
 
9
- # Initialize all tools
10
- search_tool = DuckDuckGoSearchTool()
11
  weather_info_tool = WeatherInfoTool()
12
  hub_stats_tool = HubStatsTool()
13
  guest_info_tool = GuestRetrieverTool(docs)
14
 
15
- # Create model client
16
- # client = InferenceClient(model="HuggingFaceH4/zephyr-7b-beta")
17
  model = InferenceClientModel(model_id="HuggingFaceH4/zephyr-7b-beta")
 
18
 
19
- # Create agent
20
  alfred = CodeAgent(
21
  tools=[guest_info_tool, weather_info_tool, hub_stats_tool, search_tool],
22
  model=model,
23
  add_base_tools=True,
24
- planning_interval=3
25
  )
26
 
27
  def respond(message, history):
 
1
  import gradio as gr
2
  from smolagents import CodeAgent, InferenceClientModel
3
+ from tools import WeatherInfoTool, HubStatsTool, DDGSearchTool
 
 
4
  from retriever import GuestRetrieverTool, docs
 
5
 
6
+ # Tools
7
+ search_tool = DDGSearchTool()
8
  weather_info_tool = WeatherInfoTool()
9
  hub_stats_tool = HubStatsTool()
10
  guest_info_tool = GuestRetrieverTool(docs)
11
 
12
+ # Model
 
13
  model = InferenceClientModel(model_id="HuggingFaceH4/zephyr-7b-beta")
14
+ # If needed: InferenceClientModel(model_id="...", token="YOUR_HF_TOKEN")
15
 
16
+ # Agent
17
  alfred = CodeAgent(
18
  tools=[guest_info_tool, weather_info_tool, hub_stats_tool, search_tool],
19
  model=model,
20
  add_base_tools=True,
21
+ planning_interval=3,
22
  )
23
 
24
  def respond(message, history):