Spaces:
Runtime error
Runtime error
Download smolagent_test.py from franckberneron/First_agent_template: direct link, hf CLI and curl.
- Browser
- Download file 481 Bytes
-
https://huggingface.co/spaces/franckberneron/First_agent_template/resolve/main/smolagent_test.py
- Command line
-
hf download hf://spaces/franckberneron/First_agent_template/smolagent_test.py
-
curl -L -o smolagent_test.py https://huggingface.co/spaces/franckberneron/First_agent_template/resolve/main/smolagent_test.py
481 Bytes
| # Create a CodeAgent with DuckDuckGo search capability | |
| from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel | |
| web_search = DuckDuckGoSearchTool() | |
| model = HfApiModel( | |
| max_tokens=2096, | |
| temperature=0.5, | |
| model_id='Qwen/Qwen2.5-Coder-32B-Instruct',# it is possible that this model may be overloaded | |
| custom_role_conversions=None, | |
| ) | |
| agent = CodeAgent( | |
| tools=[web_search], # Add search tool here | |
| model=model # Add model here | |
| ) | |