Spaces:
Running
Running
Download app.py from dev2089/devrayog-api: direct link, hf CLI and curl.
- Browser
- Download file 1.93 kB
-
https://huggingface.co/spaces/dev2089/devrayog-api/resolve/fc91339141faa3be55bd00a3679111f5cbc0728c/app.py
- Command line
-
hf download hf://spaces/dev2089/devrayog-api@fc91339141faa3be55bd00a3679111f5cbc0728c/app.py
-
curl -L -o app.py https://huggingface.co/spaces/dev2089/devrayog-api/resolve/fc91339141faa3be55bd00a3679111f5cbc0728c/app.py
1.93 kB
| """ | |
| Devrayog AI - Minimal App for Hugging Face Spaces | |
| Uses only pre-installed dependencies | |
| """ | |
| import gradio as gr | |
| def chat(message, model_name): | |
| if not message.strip(): | |
| return "Please enter a message." | |
| responses = { | |
| "Devrayog Agni (Fast)": f"๐ฅ [Devrayog Agni]\n\nMessage: '{message}'\n\nI'm Agni, the fast model. I help with quick answers, coding, daily tasks, and SSB prep. How can I assist you?", | |
| "Devrayog Vayu (Creative)": f"๐ [Devrayog Vayu]\n\nMessage: '{message}'\n\nI'm Vayu, the creative model. I excel at storytelling, brainstorming, and content generation.", | |
| "Devrayog Akash (Powerful)": f"๐ [Devrayog Akash]\n\nAnalyzing: '{message}'\n\nI'm Akash, the most powerful model. I handle complex reasoning, analysis, and research." | |
| } | |
| return responses.get(model_name, responses["Devrayog Agni (Fast)"]) | |
| with gr.Blocks(title="Devrayog AI") as demo: | |
| gr.Markdown("# ๐ฎ๐ณ Devrayog AI") | |
| gr.Markdown("*India's First Solo-Built AI - By Devanshu Sharma (Hermes), Age 18, Rajasthan*") | |
| msg = gr.Textbox(label="Your Message", placeholder="Type here...", lines=3) | |
| model = gr.Dropdown( | |
| choices=["Devrayog Agni (Fast)", "Devrayog Vayu (Creative)", "Devrayog Akash (Powerful)"], | |
| value="Devrayog Agni (Fast)", | |
| label="Select Model" | |
| ) | |
| btn = gr.Button("Send ๐", variant="primary") | |
| output = gr.Textbox(label="Response", lines=10, interactive=False) | |
| btn.click(fn=chat, inputs=[msg, model], outputs=output) | |
| gr.Markdown(""" | |
| ### Models | |
| - ๐ฅ **Devrayog Agni** - Fast (3.8B params) | |
| - ๐ **Devrayog Vayu** - Creative (9B params) | |
| - ๐ **Devrayog Akash** - Powerful (8B params) | |
| **Founder:** Devanshu Sharma (Hermes), 18, Neem Ka Thana, Rajasthan | |
| **Tagline:** India's First Solo-Built AI | |
| ๐ Hugging Face: https://huggingface.co/dev2089 | |
| """) | |
| demo.launch(server_name="0.0.0.0", server_port=7860) | |