replace HfApiModel with InferenceClientModel and remove unused web search print statement.
Browse files
app.py
CHANGED
|
@@ -11,7 +11,7 @@ from dotenv import load_dotenv
|
|
| 11 |
from huggingface_hub import login
|
| 12 |
from smolagents import (
|
| 13 |
CodeAgent,
|
| 14 |
-
|
| 15 |
Tool,
|
| 16 |
GoogleSearchTool
|
| 17 |
)
|
|
@@ -38,9 +38,6 @@ from scripts.visual_qa import visualizer
|
|
| 38 |
|
| 39 |
web_search = GoogleSearchTool(provider="serper")
|
| 40 |
|
| 41 |
-
print(web_search(query="Donald Trump news"))
|
| 42 |
-
|
| 43 |
-
# quit()
|
| 44 |
AUTHORIZED_IMPORTS = [
|
| 45 |
"requests",
|
| 46 |
"zipfile",
|
|
@@ -86,7 +83,7 @@ BROWSER_CONFIG = {
|
|
| 86 |
|
| 87 |
os.makedirs(f"./{BROWSER_CONFIG['downloads_folder']}", exist_ok=True)
|
| 88 |
|
| 89 |
-
model =
|
| 90 |
custom_role_conversions=custom_role_conversions,
|
| 91 |
)
|
| 92 |
|
|
|
|
| 11 |
from huggingface_hub import login
|
| 12 |
from smolagents import (
|
| 13 |
CodeAgent,
|
| 14 |
+
InferenceClientModel,
|
| 15 |
Tool,
|
| 16 |
GoogleSearchTool
|
| 17 |
)
|
|
|
|
| 38 |
|
| 39 |
web_search = GoogleSearchTool(provider="serper")
|
| 40 |
|
|
|
|
|
|
|
|
|
|
| 41 |
AUTHORIZED_IMPORTS = [
|
| 42 |
"requests",
|
| 43 |
"zipfile",
|
|
|
|
| 83 |
|
| 84 |
os.makedirs(f"./{BROWSER_CONFIG['downloads_folder']}", exist_ok=True)
|
| 85 |
|
| 86 |
+
model = InferenceClientModel(
|
| 87 |
custom_role_conversions=custom_role_conversions,
|
| 88 |
)
|
| 89 |
|