Spaces:
Runtime error
Runtime error
Download app.py from HarshitSundriyal/First_agent_template: direct link, hf CLI and curl.
- Browser
- Download file 727 Bytes
-
https://huggingface.co/spaces/HarshitSundriyal/First_agent_template/resolve/cc003cf220ea4eb62df678fc8deba07aa826dc31/app.py
- Command line
-
hf download hf://spaces/HarshitSundriyal/First_agent_template@cc003cf220ea4eb62df678fc8deba07aa826dc31/app.py
-
curl -L -o app.py https://huggingface.co/spaces/HarshitSundriyal/First_agent_template/resolve/cc003cf220ea4eb62df678fc8deba07aa826dc31/app.py
727 Bytes
| from smolagents import GradioUI, {{ class_name }}, {{ agent_dict['model']['class'] }} | |
| {% for tool in tools.values() %} | |
| from scripts.{{ tool.name }} import {{ tool.__class__.__name__ }} | |
| {% endfor %} | |
| model = {{ agent_dict['model']['class'] }}() | |
| {% for tool in tools.values() %} | |
| {{ tool.name }} = {{ tool.__class__.__name__ }}() | |
| {% endfor %} | |
| agent = {{ class_name }}( | |
| model=model, | |
| tools=[{% for tool in tools.keys() %}{{ tool }}{% if not loop.last %}, {% endif %}{% endfor %}], | |
| {% for attribute_name, value in agent_dict.items() if attribute_name not in ["model", "tools", "prompt_templates"] %} | |
| {{ attribute_name }}={{ value }}, | |
| {% endfor %} | |
| prompts_path='./prompts.yaml' | |
| ) | |
| GradioUI(agent).launch() | |