petkar commited on
Commit
05084b7
·
verified ·
1 Parent(s): 7d00a22

Update app.py

Browse files

another try for a web search model

Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -20,7 +20,7 @@ from Gradio_UI import GradioUI
20
  # return "What magic will you build ?"
21
 
22
  # Load the DuckDuckGo search tool
23
- ddg = DuckDuckGoSearchTool()
24
 
25
  @tool
26
  def my_custom_tool(city1: str, city2: str) -> str:
@@ -33,9 +33,9 @@ def my_custom_tool(city1: str, city2: str) -> str:
33
  A string listing the top 5 sightseeing locations in each city.
34
  """
35
  # Search for top 5 sightseeing locations in city1
36
- results_city1 = ddg(f"top 5 sightseeing locations in {city1}")
37
  # Search for top 5 sightseeing locations in city2
38
- results_city2 = ddg(f"top 5 sightseeing locations in {city2}")
39
 
40
  # Format the results as a string
41
  output = f"Top 5 sightseeing locations in {city1}:\n"
 
20
  # return "What magic will you build ?"
21
 
22
  # Load the DuckDuckGo search tool
23
+ search_model = HfApiModel("Intelligent-Internet/II-Search-4B")
24
 
25
  @tool
26
  def my_custom_tool(city1: str, city2: str) -> str:
 
33
  A string listing the top 5 sightseeing locations in each city.
34
  """
35
  # Search for top 5 sightseeing locations in city1
36
+ results_city1 = search_model(f"top 5 sightseeing locations in {city1}")
37
  # Search for top 5 sightseeing locations in city2
38
+ results_city2 = search_model(f"top 5 sightseeing locations in {city2}")
39
 
40
  # Format the results as a string
41
  output = f"Top 5 sightseeing locations in {city1}:\n"