Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
| 1 |
import os
|
| 2 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
| 3 |
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
def who_is_bot(person_name: str) -> str:
|
| 7 |
agent = CodeAgent(
|
| 8 |
tools=[DuckDuckGoSearchTool()],
|
| 9 |
-
model=HfApiModel(
|
| 10 |
)
|
| 11 |
prompt = (
|
| 12 |
f"Who is {person_name}? "
|
|
|
|
| 1 |
import os
|
| 2 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
| 3 |
|
| 4 |
+
# Make sure token is set in env
|
| 5 |
+
os.environ["HF_TOKEN"] = "hf_xxx..." # for local test only
|
| 6 |
|
| 7 |
def who_is_bot(person_name: str) -> str:
|
| 8 |
agent = CodeAgent(
|
| 9 |
tools=[DuckDuckGoSearchTool()],
|
| 10 |
+
model=HfApiModel() # no args
|
| 11 |
)
|
| 12 |
prompt = (
|
| 13 |
f"Who is {person_name}? "
|