Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files3 unmodified lines4567891011121314151617181920212223242526272829303114 unmodified lines4647484950515253544 unmodified lines5960616263646566676831 unmodified lines1001011021031041051061071081091101111123 unmodified lines"""import gradio as grimport jsonimport timedef chat_with_devrayog(message, model_name, system_prompt):"""Send chat request to Devrayog AI"""if not message.strip():return "Please enter a message."model_responses = {"Devrayog Agni (Fast)": f"๐ฅ [Devrayog Agni - Fast Response]\n\nThank you for your message: '{message}'\n\nI'm Devrayog Agni, the fast model optimized for quick responses. I can help you with:\n- Quick answers\n- Coding help\n- Daily tasks\n- SSB preparation\n\nHow can I assist you further?","Devrayog Vayu (Creative)": f"๐ [Devrayog Vayu - Creative Response]\n\nYour message: '{message}'\n\nI'm Devrayog Vayu, the creative model. I excel at:\n- Storytelling and creative writing\n- Brainstorming ideas\n- Content generation\n- Imaginative responses\n\nLet me craft something special for you!","Devrayog Akash (Powerful)": f"๐ [Devrayog Akash - Deep Response]\n\nAnalyzing your message: '{message}'\n\nI'm Devrayog Akash, the most powerful model. I specialize in:\n- Complex reasoning\n- Deep analysis\n- Research tasks\n- Multi-step problem solving\n\nLet me provide a comprehensive response."}response = model_responses.get(model_name, model_responses["Devrayog Agni (Fast)"])if system_prompt:response = f"[System: {system_prompt}]\n\n{response}"return responsedef get_model_info():14 unmodified lines**Tagline:** India's First Solo-Built AI"""# Create Gradio interfacewith gr.Blocks(title="Devrayog AI") as demo:gr.Markdown("# ๐ฎ๐ณ Devrayog AI")gr.Markdown("*India's First Solo-Built AI - Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan*")4 unmodified linesvalue="Devrayog Agni (Fast)",label="Select Model")system_prompt_input = gr.Textbox(label="System Prompt (Optional)", placeholder="Set a custom system prompt...", lines=2)chat_btn = gr.Button("Send ๐", variant="primary")chat_output = gr.Textbox(label="Response", lines=10, interactive=False)chat_btn.click(fn=chat_with_devrayog, inputs=[chat_input, model_select, system_prompt_input], outputs=chat_output)with gr.Tab("๐ Models"):31 unmodified lines- **Devrayog Vayu** - Creative and flowing (9B)- **Devrayog Akash** - Most powerful (8B)### Links- Hugging Face: https://huggingface.co/dev2089- Founder: Devanshu Sharma (Hermes), Age 18, Rajasthan---*Built with โค๏ธ in India ๐ฎ๐ณ*""")if __name__ == "__main__":demo.launch(server_name="0.0.0.0", server_port=7860)3 unmodified lines456789101112131415161718192021222314 unmodified lines383940414243444 unmodified lines49505152535455565731 unmodified lines8990919293949596973 unmodified lines"""import gradio as grdef chat_with_devrayog(message, model_name, system_prompt):if not message.strip():return "Please enter a message."model_responses = {"Devrayog Agni (Fast)": f"๐ฅ [Devrayog Agni - Fast Response]\n\nYour message: '{message}'\n\nI'm Devrayog Agni, the fast model optimized for quick responses. I can help with:\n- Quick answers\n- Coding help\n- Daily tasks\n- SSB preparation\n\nHow can I assist you further?","Devrayog Vayu (Creative)": f"๐ [Devrayog Vayu - Creative Response]\n\nYour message: '{message}'\n\nI'm Devrayog Vayu, the creative model. I excel at:\n- Storytelling and creative writing\n- Brainstorming ideas\n- Content generation\n- Imaginative responses\n\nLet me craft something special for you!","Devrayog Akash (Powerful)": f"๐ [Devrayog Akash - Deep Response]\n\nAnalyzing: '{message}'\n\nI'm Devrayog Akash, the most powerful model. I specialize in:\n- Complex reasoning\n- Deep analysis\n- Research tasks\n- Multi-step problem solving\n\nLet me provide a comprehensive response."}response = model_responses.get(model_name, model_responses["Devrayog Agni (Fast)"])if system_prompt:response = f"[System: {system_prompt}]\n\n{response}"return responsedef get_model_info():14 unmodified lines**Tagline:** India's First Solo-Built AI"""with gr.Blocks(title="Devrayog AI") as demo:gr.Markdown("# ๐ฎ๐ณ Devrayog AI")gr.Markdown("*India's First Solo-Built AI - Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan*")4 unmodified linesvalue="Devrayog Agni (Fast)",label="Select Model")system_prompt_input = gr.Textbox(label="System Prompt (Optional)", placeholder="Set custom system prompt...", lines=2)chat_btn = gr.Button("Send ๐", variant="primary")chat_output = gr.Textbox(label="Response", lines=10, interactive=False)chat_btn.click(fn=chat_with_devrayog, inputs=[chat_input, model_select, system_prompt_input], outputs=chat_output)with gr.Tab("๐ Models"):31 unmodified lines- **Devrayog Vayu** - Creative and flowing (9B)- **Devrayog Akash** - Most powerful (8B)---*Built with โค๏ธ in India ๐ฎ๐ณ*""")if __name__ == "__main__":demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
app.py+4-19