Spaces:
Runtime error
Runtime error
Gonzalo Lope
commited on
Commit
·
8a760ab
1
Parent(s):
ae422a8
added hugging face token
Browse files- smolagents_test_new.py +3 -1
smolagents_test_new.py
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
from huggingface_hub import login
|
| 2 |
from smolagents import CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, WikipediaSearchTool
|
| 3 |
from smolagents import tool
|
|
|
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
|
| 7 |
@tool
|
|
@@ -14,7 +16,7 @@ def reverse_string(input_string: str) -> str:
|
|
| 14 |
"""
|
| 15 |
return input_string[::-1]
|
| 16 |
|
| 17 |
-
agent = CodeAgent(tools=[DuckDuckGoSearchTool(),reverse_string,WikipediaSearchTool()], model=InferenceClientModel())
|
| 18 |
|
| 19 |
|
| 20 |
if __name__ == "__main__":
|
|
|
|
| 1 |
from huggingface_hub import login
|
| 2 |
from smolagents import CodeAgent, InferenceClientModel, DuckDuckGoSearchTool, WikipediaSearchTool
|
| 3 |
from smolagents import tool
|
| 4 |
+
import os
|
| 5 |
|
| 6 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 7 |
|
| 8 |
|
| 9 |
@tool
|
|
|
|
| 16 |
"""
|
| 17 |
return input_string[::-1]
|
| 18 |
|
| 19 |
+
agent = CodeAgent(tools=[DuckDuckGoSearchTool(),reverse_string,WikipediaSearchTool()], model=InferenceClientModel(token=hf_token))
|
| 20 |
|
| 21 |
|
| 22 |
if __name__ == "__main__":
|