Spaces:
Sleeping
Sleeping
Update app.py
Browse filesanother try for a web search model
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 |
-
|
| 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 =
|
| 37 |
# Search for top 5 sightseeing locations in city2
|
| 38 |
-
results_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"
|