dev2089 commited on
Commit
db59930
ยท
verified ยท
1 Parent(s): be0504e

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +48 -54
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
- model_responses = {
13
- "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?",
14
- "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!",
15
- "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."
16
  }
17
 
18
- response = model_responses.get(model_name, model_responses["Devrayog Agni (Fast)"])
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 - Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan*")
44
 
45
  with gr.Tab("๐Ÿ’ฌ Chat"):
46
- chat_input = gr.Textbox(label="Your Message", placeholder="Type your message here...", lines=3)
47
- model_select = gr.Dropdown(
48
  choices=["Devrayog Agni (Fast)", "Devrayog Vayu (Creative)", "Devrayog Akash (Powerful)"],
49
  value="Devrayog Agni (Fast)",
50
- label="Select Model"
51
  )
52
- system_prompt_input = gr.Textbox(label="System Prompt (Optional)", placeholder="Set custom system prompt...", lines=2)
53
- chat_btn = gr.Button("Send ๐Ÿš€", variant="primary")
54
- chat_output = gr.Textbox(label="Response", lines=10, interactive=False)
55
- chat_btn.click(fn=chat_with_devrayog, inputs=[chat_input, model_select, system_prompt_input], outputs=chat_output)
56
 
57
  with gr.Tab("๐Ÿ“š Models"):
58
- gr.Markdown(get_model_info())
 
 
 
 
 
 
 
 
 
 
 
 
59
 
60
  with gr.Tab("๐ŸŽฏ SSB Prep"):
61
  gr.Markdown("""
62
- ## SSB Interview Preparation
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 (GD, GPE, PGT, HGT, Command Task, FGT)
68
  - **Day 5:** Conference
69
 
70
- ### Quick Tips
71
- - Be yourself, don't fake
72
- - Practice OIR daily
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
- **Devrayog AI** is India's first solo-built AI company, founded by **Devanshu Sharma (Hermes)**, an 18-year-old from Neem Ka Thana, Rajasthan.
 
 
83
 
84
- ### Mission
85
- To build India's most accessible and powerful AI, created by a young Indian founder from a small town.
86
 
87
- ### Models
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
- if __name__ == "__main__":
97
- demo.launch(server_name="0.0.0.0", server_port=7860, share=True)
 
 
 
 
 
 
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
+ )