Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -2,7 +2,8 @@ import logging
|
|
| 2 |
import hashlib
|
| 3 |
import json
|
| 4 |
import os
|
| 5 |
-
from smolagents import CodeAgent,
|
|
|
|
| 6 |
|
| 7 |
# Set up logging
|
| 8 |
logging.basicConfig(level=logging.INFO)
|
|
@@ -69,8 +70,8 @@ def web_search(query: str) -> str:
|
|
| 69 |
return f"Search error: {e}"
|
| 70 |
|
| 71 |
# ---------- Agent ----------
|
| 72 |
-
#
|
| 73 |
-
model =
|
| 74 |
|
| 75 |
# Only include web_search if the package is installed
|
| 76 |
tools = [calculator]
|
|
|
|
| 2 |
import hashlib
|
| 3 |
import json
|
| 4 |
import os
|
| 5 |
+
from smolagents import CodeAgent, tool
|
| 6 |
+
from smolagents.models import HfApiModel # Correct import for HfApiModel
|
| 7 |
|
| 8 |
# Set up logging
|
| 9 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 70 |
return f"Search error: {e}"
|
| 71 |
|
| 72 |
# ---------- Agent ----------
|
| 73 |
+
# Use HfApiModel with a specific model ID (you can change this)
|
| 74 |
+
model = HfApiModel(model_id="HuggingFaceH4/zephyr-7b-beta") # or any other model
|
| 75 |
|
| 76 |
# Only include web_search if the package is installed
|
| 77 |
tools = [calculator]
|