Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files16 unmodified lines171819202021222324 unmodified lines4849505152515253545455565657585758596061606162646364656667686969707172737475767778707172738074757677787980818283828384858685868788878889909192939416 unmodified lines "gto": "GTO Tasks: Group Discussion, Group Planning, Progressive Group Task, Half Group Task, Command Task, Final Group Task.",
"15 olqs": "15 Officer-Like Qualities:\n1. Effective Intelligence\n2. Reasoning Ability\n3. Organizing Ability\n4. Power of Expression\n5. Social Adaptability\n6. Cooperation\n7. Sense of Responsibility\n8. Initiative\n9. Self Confidence\n10. Speed of Decision\n11. Ability to Influence\n12. Liveliness\n13. Determination\n14. Courage\n15. Stamina",
"devrayog": "Devrayog AI is India's first solo-built AI, founded by Devanshu Sharma (Hermes), 18, from Neem Ka Thana, Rajasthan. 3 models: Agni (Fast), Vayu (Creative), Akash (Powerful).",
"hello": "Hello! I'm Devrayog AI, India's first solo-built AI. I can help with:\nโข SSB Interview Prep\nโข NDA Exam Info\nโข TAT/WAT/SRT/PPDT Tips\nโข Current Affairs\n\nTry: 'What is SSB?', 'SSB tips', '15 OLQs', 'What is NDA?'",
"hello": "Hello! I'm Devrayog AI, India's first solo-built AI. I can help with:\n- SSB Interview Prep\n- NDA Exam Info\n- TAT/WAT/SRT/PPDT Tips\n- Current Affairs\n\nTry: 'What is SSB?', 'SSB tips', '15 OLQs', 'What is NDA?'",
}
def get_response(msg):24 unmodified lines if any(w in msg for w in ["devrayog","hermes","founder","about"]):
return KB["devrayog"]
if any(w in msg for w in ["help","what can","how to use"]):
return "I can help with:\n๐ฏ SSB Process & Tips\n๐ NDA Exam Info\n๐ผ๏ธ TAT/WAT/SRT/PPDT\nโญ 15 OLQs\n๐ฎ๐ณ Current Affairs\n\nJust ask! Try: 'What is SSB?', 'SSB tips', '15 OLQs'"
return f"Thanks for asking about '{msg}'! I'm Devrayog AI, still learning. Try asking about SSB, NDA, TAT, WAT, SRT, PPDT, GTO, or 15 OLQs for detailed answers!"
return "I can help with:\n- SSB Process & Tips\n- NDA Exam Info\n- TAT/WAT/SRT/PPDT\n- 15 OLQs\n- Current Affairs\n\nJust ask!"
return f"Thanks for asking about '{msg}'! Try: SSB, NDA, TAT, WAT, SRT, PPDT, GTO, 15 OLQs"
def chat(message, history, model):
def respond(message, model):
"""Simple respond function - takes message and model, returns response"""
if not message.strip():
return history or [], ""
history = history or []
prefix = {"Agni": "๐ฅ ", "Vayu": "๐ ", "Akash": "๐ "}.get(model, "๐ฅ ")
return ""
prefix = {"Agni": "[Agni] ", "Vayu": "[Vayu] ", "Akash": "[Akash] "}.get(model, "[Agni] ")
response = get_response(message)
history.append((message, prefix + response))
return history, ""
return prefix + response
with gr.Blocks(title="Devrayog AI") as demo:
gr.Markdown("# ๐ฎ๐ณ Devrayog AI")
gr.Markdown("# Devrayog AI")
gr.Markdown("*India's First Solo-Built AI | Hermes, 18, Rajasthan*")
model = gr.Radio(["Agni", "Vayu", "Akash"], value="Agni", label="Model")
with gr.Row():
with gr.Column(scale=3):
model = gr.Radio(["Agni", "Vayu", "Akash"], value="Agni", label="Model")
chatbot = gr.Chatbot(height=350, show_label=False)
with gr.Row():
msg = gr.Textbox(placeholder="Ask about SSB, NDA, TAT...", scale=4, container=False, autofocus=True)
send = gr.Button("Send", scale=1, variant="primary")
with gr.Row():
b1 = gr.Button("๐ฏ SSB", size="sm")
b2 = gr.Button("๐ NDA", size="sm")
b3 = gr.Button("๐ก Tips", size="sm")
b4 = gr.Button("โญ OLQs", size="sm")
msg = gr.Textbox(placeholder="Ask about SSB, NDA, TAT...", container=False, autofocus=True, label="Your Question")
output = gr.Textbox(lines=10, label="Devrayog AI Response", interactive=False)
send = gr.Button("Send", variant="primary")
with gr.Column(scale=1):
gr.Markdown("### Models\n๐ฅ **Agni** - Fast\n๐ **Vayu** - Creative\n๐ **Akash** - Powerful\n\n### Topics\nโข SSB Process\nโข TAT/WAT/SRT\nโข NDA Exam\nโข 15 OLQs\nโข GTO Tasks")
gr.Markdown("### Quick Topics")
b1 = gr.Button("SSB Process")
b2 = gr.Button("NDA Info")
b3 = gr.Button("SSB Tips")
b4 = gr.Button("15 OLQs")
b5 = gr.Button("TAT Tips")
b6 = gr.Button("WAT Tips")
gr.Markdown("### Models: Agni (Fast) | Vayu (Creative) | Akash (Powerful)")
send.click(fn=chat, inputs=[msg, chatbot, model], outputs=[chatbot, msg])
msg.submit(fn=chat, inputs=[msg, chatbot, model], outputs=[chatbot, msg])
send.click(fn=respond, inputs=[msg, model], outputs=[output])
msg.submit(fn=respond, inputs=[msg, model], outputs=[output])
b1.click(fn=lambda h, m: chat("What is SSB process?", h, m), inputs=[chatbot, model], outputs=[chatbot, msg])
b2.click(fn=lambda h, m: chat("What is NDA?", h, m), inputs=[chatbot, model], outputs=[chatbot, msg])
b3.click(fn=lambda h, m: chat("SSB tips", h, m), inputs=[chatbot, model], outputs=[chatbot, msg])
b4.click(fn=lambda h, m: chat("15 OLQs", h, m), inputs=[chatbot, model], outputs=[chatbot, msg])
b1.click(fn=lambda m: respond("What is SSB process?", m), inputs=[model], outputs=[output])
b2.click(fn=lambda m: respond("What is NDA?", m), inputs=[model], outputs=[output])
b3.click(fn=lambda m: respond("SSB tips", m), inputs=[model], outputs=[output])
b4.click(fn=lambda m: respond("15 OLQs", m), inputs=[model], outputs=[output])
b5.click(fn=lambda m: respond("TAT tips", m), inputs=[model], outputs=[output])
b6.click(fn=lambda m: respond("WAT tips", m), inputs=[model], outputs=[output])
demo.launch(server_name="0.0.0.0", server_port=7860)app.py+31-27