dev2089 commited on
Commit
27ac8d8
ยท
verified ยท
1 Parent(s): d9e166c

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +25 -71
app.py CHANGED
@@ -1,91 +1,45 @@
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
- )
 
1
  """
2
+ Devrayog AI - Minimal App for Hugging Face Spaces
3
+ Uses only pre-installed dependencies
4
  """
5
 
6
  import gradio as gr
 
7
 
8
+ def chat(message, model_name):
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 assist you?",
14
+ "Devrayog Vayu (Creative)": f"๐ŸŒŠ [Devrayog Vayu]\n\nMessage: '{message}'\n\nI'm Vayu, the creative model. I excel at storytelling, brainstorming, and content generation.",
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."
16
  }
17
+ return responses.get(model_name, responses["Devrayog Agni (Fast)"])
 
 
 
 
18
 
19
  with gr.Blocks(title="Devrayog AI") as demo:
20
  gr.Markdown("# ๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI")
21
  gr.Markdown("*India's First Solo-Built AI - By Devanshu Sharma (Hermes), Age 18, Rajasthan*")
22
 
23
+ msg = gr.Textbox(label="Your Message", placeholder="Type here...", lines=3)
24
+ model = gr.Dropdown(
25
+ choices=["Devrayog Agni (Fast)", "Devrayog Vayu (Creative)", "Devrayog Akash (Powerful)"],
26
+ value="Devrayog Agni (Fast)",
27
+ label="Select Model"
28
+ )
29
+ btn = gr.Button("Send ๐Ÿš€", variant="primary")
30
+ output = gr.Textbox(label="Response", lines=10, interactive=False)
31
+ btn.click(fn=chat, inputs=[msg, model], outputs=output)
 
 
32
 
33
+ gr.Markdown("""
34
+ ### Models
35
+ - ๐Ÿ”ฅ **Devrayog Agni** - Fast (3.8B params)
36
+ - ๐ŸŒŠ **Devrayog Vayu** - Creative (9B params)
37
+ - ๐ŸŒŒ **Devrayog Akash** - Powerful (8B params)
 
 
 
 
 
38
 
 
39
  **Founder:** Devanshu Sharma (Hermes), 18, Neem Ka Thana, Rajasthan
40
+ **Tagline:** India's First Solo-Built AI
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
+ ๐Ÿ”— Hugging Face: https://huggingface.co/dev2089
43
+ """)
 
44
 
45
+ demo.launch(server_name="0.0.0.0", server_port=7860)