Download main.py from Punisher2444/Final_Assignment_Template: direct link, hf CLI and curl.
- Browser
- Download file 563 Bytes
-
https://huggingface.co/spaces/Punisher2444/Final_Assignment_Template/resolve/main/main.py
- Command line
-
hf download hf://spaces/Punisher2444/Final_Assignment_Template/main.py
-
curl -L -o main.py https://huggingface.co/spaces/Punisher2444/Final_Assignment_Template/resolve/main/main.py
563 Bytes
| import gradio as gr | |
| from agent_config import create_agent | |
| agent = create_agent() | |
| def ask_agent(prompt: str) -> str: | |
| try: | |
| return agent.run(prompt) | |
| except Exception as e: | |
| return f"Error: {e}" | |
| iface = gr.Interface( | |
| fn=ask_agent, | |
| inputs=gr.Textbox(lines=2, placeholder="Ask the agent something..."), | |
| outputs="text", | |
| title="Agent with smolagents + DeepSeek", | |
| description="This agent uses smolagents, DeepSeek LLM, and custom tools to answer factual and data questions. ", | |
| ) | |
| if __name__ == "__main__": | |
| iface.launch() | |