Spaces:
Sleeping
Sleeping
Download app.py from Jerga/First_agent_template: direct link, hf CLI and curl.
- Browser
- Download file 840 Bytes
-
https://huggingface.co/spaces/Jerga/First_agent_template/resolve/fe328e0776a3e4191515658ad4307b213dfb6049/app.py
- Command line
-
hf download hf://spaces/Jerga/First_agent_template@fe328e0776a3e4191515658ad4307b213dfb6049/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Jerga/First_agent_template/resolve/fe328e0776a3e4191515658ad4307b213dfb6049/app.py
840 Bytes
| from smolagents import GradioUI, CodeAgent, HfApiModel | |
| from scripts.web_search import DuckDuckGoSearchTool | |
| from scripts.visit_webpage import VisitWebpageTool | |
| from scripts.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=['statistics', 'unicodedata', 'collections', 'queue', 'time', 'pandas', 'stat', 'random', 'datetime', 're', 'math', 'itertools'], | |
| prompts_path='./prompts.yaml' | |
| ) | |
| GradioUI(agent).launch() |