Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,97 +1,91 @@
|
|
| 1 |
"""
|
| 2 |
-
Devrayog AI - Gradio Web App
|
| 3 |
-
Deployed on Hugging Face Spaces
|
| 4 |
"""
|
| 5 |
|
| 6 |
import gradio as gr
|
|
|
|
| 7 |
|
| 8 |
def chat_with_devrayog(message, model_name, system_prompt):
|
| 9 |
if not message.strip():
|
| 10 |
return "Please enter a message."
|
| 11 |
|
| 12 |
-
|
| 13 |
-
"Devrayog Agni (Fast)": f"๐ฅ [Devrayog Agni
|
| 14 |
-
"Devrayog Vayu (Creative)": f"๐ [Devrayog Vayu
|
| 15 |
-
"Devrayog Akash (Powerful)": f"๐ [Devrayog Akash
|
| 16 |
}
|
| 17 |
|
| 18 |
-
response =
|
| 19 |
if system_prompt:
|
| 20 |
response = f"[System: {system_prompt}]\n\n{response}"
|
| 21 |
return response
|
| 22 |
|
| 23 |
-
def get_model_info():
|
| 24 |
-
return """
|
| 25 |
-
## Devrayog AI Models
|
| 26 |
-
|
| 27 |
-
### ๐ฅ Devrayog Agni (Fast) - 3.8B parameters
|
| 28 |
-
Best for: Quick responses, coding, daily tasks
|
| 29 |
-
|
| 30 |
-
### ๐ Devrayog Vayu (Creative) - 9B parameters
|
| 31 |
-
Best for: Storytelling, brainstorming, content generation
|
| 32 |
-
|
| 33 |
-
### ๐ Devrayog Akash (Powerful) - 8B parameters
|
| 34 |
-
Best for: Complex reasoning, analysis, research
|
| 35 |
-
|
| 36 |
-
---
|
| 37 |
-
**Founder:** Devanshu Sharma (Hermes), Age 18, Neem Ka Thana, Rajasthan
|
| 38 |
-
**Tagline:** India's First Solo-Built AI
|
| 39 |
-
"""
|
| 40 |
-
|
| 41 |
with gr.Blocks(title="Devrayog AI") as demo:
|
| 42 |
gr.Markdown("# ๐ฎ๐ณ Devrayog AI")
|
| 43 |
-
gr.Markdown("*India's First Solo-Built AI -
|
| 44 |
|
| 45 |
with gr.Tab("๐ฌ Chat"):
|
| 46 |
-
|
| 47 |
-
|
| 48 |
choices=["Devrayog Agni (Fast)", "Devrayog Vayu (Creative)", "Devrayog Akash (Powerful)"],
|
| 49 |
value="Devrayog Agni (Fast)",
|
| 50 |
-
label="
|
| 51 |
)
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
|
| 57 |
with gr.Tab("๐ Models"):
|
| 58 |
-
gr.Markdown(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
with gr.Tab("๐ฏ SSB Prep"):
|
| 61 |
gr.Markdown("""
|
| 62 |
-
## SSB
|
| 63 |
-
|
| 64 |
-
### 5-Day Process
|
| 65 |
- **Day 1:** Screening (OIR + PPDT)
|
| 66 |
- **Day 2:** Psychology (TAT, WAT, SRT, SD)
|
| 67 |
-
- **Day 3-4:** GTO Tasks
|
| 68 |
- **Day 5:** Conference
|
| 69 |
|
| 70 |
-
###
|
| 71 |
-
- Be yourself
|
| 72 |
-
-
|
| 73 |
-
- Write 6 TAT stories daily
|
| 74 |
-
- Stay updated with current affairs
|
| 75 |
-
- Maintain physical fitness
|
| 76 |
""")
|
| 77 |
|
| 78 |
with gr.Tab("โน๏ธ About"):
|
| 79 |
gr.Markdown("""
|
| 80 |
-
## About Devrayog AI
|
|
|
|
|
|
|
| 81 |
|
| 82 |
-
**
|
|
|
|
|
|
|
| 83 |
|
| 84 |
-
|
| 85 |
-
To build India's most accessible and powerful AI, created by a young Indian founder from a small town.
|
| 86 |
|
| 87 |
-
|
| 88 |
-
- **Devrayog Agni** - Fast and sharp (3.8B)
|
| 89 |
-
- **Devrayog Vayu** - Creative and flowing (9B)
|
| 90 |
-
- **Devrayog Akash** - Most powerful (8B)
|
| 91 |
|
| 92 |
---
|
| 93 |
*Built with โค๏ธ in India ๐ฎ๐ณ*
|
| 94 |
""")
|
| 95 |
|
| 96 |
-
|
| 97 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
"""
|
| 2 |
+
Devrayog AI - Gradio Web App for Hugging Face Spaces
|
|
|
|
| 3 |
"""
|
| 4 |
|
| 5 |
import gradio as gr
|
| 6 |
+
import os
|
| 7 |
|
| 8 |
def chat_with_devrayog(message, model_name, system_prompt):
|
| 9 |
if not message.strip():
|
| 10 |
return "Please enter a message."
|
| 11 |
|
| 12 |
+
responses = {
|
| 13 |
+
"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 help?",
|
| 14 |
+
"Devrayog Vayu (Creative)": f"๐ [Devrayog Vayu]\n\nMessage: '{message}'\n\nI'm Vayu, the creative model. I excel at storytelling, brainstorming, and content. What shall we create?",
|
| 15 |
+
"Devrayog Akash (Powerful)": f"๐ [Devrayog Akash]\n\nAnalyzing: '{message}'\n\nI'm Akash, the most powerful model. I handle complex reasoning, analysis, and research. Let me think deeply."
|
| 16 |
}
|
| 17 |
|
| 18 |
+
response = responses.get(model_name, responses["Devrayog Agni (Fast)"])
|
| 19 |
if system_prompt:
|
| 20 |
response = f"[System: {system_prompt}]\n\n{response}"
|
| 21 |
return response
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
with gr.Blocks(title="Devrayog AI") as demo:
|
| 24 |
gr.Markdown("# ๐ฎ๐ณ Devrayog AI")
|
| 25 |
+
gr.Markdown("*India's First Solo-Built AI - By Devanshu Sharma (Hermes), Age 18, Rajasthan*")
|
| 26 |
|
| 27 |
with gr.Tab("๐ฌ Chat"):
|
| 28 |
+
msg = gr.Textbox(label="Message", placeholder="Type here...", lines=3)
|
| 29 |
+
model = gr.Dropdown(
|
| 30 |
choices=["Devrayog Agni (Fast)", "Devrayog Vayu (Creative)", "Devrayog Akash (Powerful)"],
|
| 31 |
value="Devrayog Agni (Fast)",
|
| 32 |
+
label="Model"
|
| 33 |
)
|
| 34 |
+
sys_prompt = gr.Textbox(label="System Prompt (Optional)", lines=2)
|
| 35 |
+
btn = gr.Button("Send ๐", variant="primary")
|
| 36 |
+
output = gr.Textbox(label="Response", lines=10, interactive=False)
|
| 37 |
+
btn.click(fn=chat_with_devrayog, inputs=[msg, model, sys_prompt], outputs=output)
|
| 38 |
|
| 39 |
with gr.Tab("๐ Models"):
|
| 40 |
+
gr.Markdown("""
|
| 41 |
+
### ๐ฅ Devrayog Agni (Fast) - 3.8B
|
| 42 |
+
Quick responses, coding, daily tasks
|
| 43 |
+
|
| 44 |
+
### ๐ Devrayog Vayu (Creative) - 9B
|
| 45 |
+
Storytelling, brainstorming, content
|
| 46 |
+
|
| 47 |
+
### ๐ Devrayog Akash (Powerful) - 8B
|
| 48 |
+
Complex reasoning, analysis, research
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
**Founder:** Devanshu Sharma (Hermes), 18, Neem Ka Thana, Rajasthan
|
| 52 |
+
""")
|
| 53 |
|
| 54 |
with gr.Tab("๐ฏ SSB Prep"):
|
| 55 |
gr.Markdown("""
|
| 56 |
+
### 5-Day SSB Process
|
|
|
|
|
|
|
| 57 |
- **Day 1:** Screening (OIR + PPDT)
|
| 58 |
- **Day 2:** Psychology (TAT, WAT, SRT, SD)
|
| 59 |
+
- **Day 3-4:** GTO Tasks
|
| 60 |
- **Day 5:** Conference
|
| 61 |
|
| 62 |
+
### Tips
|
| 63 |
+
- Be yourself | Practice OIR daily | Write 6 TAT stories/day
|
| 64 |
+
- Current affairs | Physical fitness | Confidence
|
|
|
|
|
|
|
|
|
|
| 65 |
""")
|
| 66 |
|
| 67 |
with gr.Tab("โน๏ธ About"):
|
| 68 |
gr.Markdown("""
|
| 69 |
+
### About Devrayog AI
|
| 70 |
+
|
| 71 |
+
India's first solo-built AI company.
|
| 72 |
|
| 73 |
+
**Founder:** Devanshu Sharma (Hermes)
|
| 74 |
+
**Age:** 18
|
| 75 |
+
**From:** Neem Ka Thana, Rajasthan
|
| 76 |
|
| 77 |
+
**Mission:** Build India's most accessible AI.
|
|
|
|
| 78 |
|
| 79 |
+
**Models:** Agni (Fast) | Vayu (Creative) | Akash (Powerful)
|
|
|
|
|
|
|
|
|
|
| 80 |
|
| 81 |
---
|
| 82 |
*Built with โค๏ธ in India ๐ฎ๐ณ*
|
| 83 |
""")
|
| 84 |
|
| 85 |
+
# Launch - HF Spaces compatible
|
| 86 |
+
demo.launch(
|
| 87 |
+
server_name="0.0.0.0",
|
| 88 |
+
server_port=7860,
|
| 89 |
+
share=False,
|
| 90 |
+
quiet=True
|
| 91 |
+
)
|