Spaces:
Sleeping
Sleeping
Download app.py from andrecodea/First_agent_template: direct link, hf CLI and curl.
- Browser
- Download file 834 Bytes
-
https://huggingface.co/spaces/andrecodea/First_agent_template/resolve/fa1d5b17103c127877d235a16e653cb8ebe7dc8d/app.py
- Command line
-
hf download hf://spaces/andrecodea/First_agent_template@fa1d5b17103c127877d235a16e653cb8ebe7dc8d/app.py
-
curl -L -o app.py https://huggingface.co/spaces/andrecodea/First_agent_template/resolve/fa1d5b17103c127877d235a16e653cb8ebe7dc8d/app.py
834 Bytes
| from smolagents import GradioUI, CodeAgent, HfApiModel | |
| from tools.web_search import DuckDuckGoSearchTool | |
| from tools.visit_webpage import VisitWebpageTool | |
| from tools.final_answer import FinalAnswerTool | |
| model = HfApiModel( | |
| model_id='Qwen/Qwen2.5-Coder-32B-Instruct', | |
| custom_role_conversions=None, | |
| ) | |
| web_search = DuckDuckGoSearchTool() | |
| visit_webpage = VisitWebpageTool() | |
| final_answer = FinalAnswerTool() | |
| agent = CodeAgent( | |
| model=model, | |
| tools=[web_search, visit_webpage, final_answer], | |
| max_steps=6, | |
| verbosity_level=1, | |
| grammar=None, | |
| planning_interval=None, | |
| name=None, | |
| description=None, | |
| authorized_imports=['unicodedata', 'math', 'queue', 're', 'itertools', 'random', 'stat', 'collections', 'datetime', 'time', 'statistics', 'pandas'], | |
| prompts_path='./prompts.yaml' | |
| ) | |
| GradioUI(agent).launch() |