dev2089 commited on
Commit
6b255bb
ยท
verified ยท
1 Parent(s): d352e69

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +31 -102
app.py CHANGED
@@ -4,29 +4,21 @@ Deployed on Hugging Face Spaces
4
  """
5
 
6
  import gradio as gr
7
- import requests
8
  import json
9
- import os
10
  import time
11
 
12
- # API endpoint (will be updated after deployment)
13
- API_URL = os.environ.get("API_URL", "https://devrayog-ai.hf.space")
14
-
15
  def chat_with_devrayog(message, model_name, system_prompt):
16
- """Send chat request to Devrayog AI API"""
17
 
18
  if not message.strip():
19
  return "Please enter a message."
20
 
21
- # For now, provide a working demo response
22
- # In production, this will call the actual model API
23
-
24
  model_responses = {
25
- "Devrayog Agni (Fast)": f"๐Ÿ”ฅ [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?",
26
 
27
- "Devrayog Vayu (Creative)": f"๐ŸŒŠ [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!",
28
 
29
- "Devrayog Akash (Powerful)": f"๐ŸŒŒ [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."
30
  }
31
 
32
  response = model_responses.get(model_name, model_responses["Devrayog Agni (Fast)"])
@@ -37,114 +29,54 @@ def chat_with_devrayog(message, model_name, system_prompt):
37
  return response
38
 
39
  def get_model_info():
40
- """Get information about available models"""
41
  return """
42
  ## Devrayog AI Models
43
 
44
- ### ๐Ÿ”ฅ Devrayog Agni (Fast)
45
- - **Parameters:** 3.8B
46
- - **Base:** Phi-3-mini-4k-instruct
47
- - **Best for:** Quick responses, coding, daily tasks
48
 
49
- ### ๐ŸŒŠ Devrayog Vayu (Creative)
50
- - **Parameters:** 9B
51
- - **Base:** Gemma-2-9b-it
52
- - **Best for:** Storytelling, brainstorming, content
53
 
54
- ### ๐ŸŒŒ Devrayog Akash (Powerful)
55
- - **Parameters:** 8B
56
- - **Base:** Llama-3.1-8B-Instruct
57
- - **Best for:** Complex reasoning, analysis, research
58
 
59
  ---
60
-
61
  **Founder:** Devanshu Sharma (Hermes), Age 18, Neem Ka Thana, Rajasthan
62
-
63
  **Tagline:** India's First Solo-Built AI
64
  """
65
 
66
  # Create Gradio interface
67
- with gr.Blocks(
68
- title="Devrayog AI - India's First Solo-Built AI",
69
- theme=gr.themes.Soft(),
70
- css="""
71
- .gradio-container {font-family: 'Segoe UI', sans-serif;}
72
- .main-title {text-align: center; color: #FF6B35;}
73
- """
74
- ) as demo:
75
 
76
- gr.Markdown("# ๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI", elem_classes=["main-title"])
77
- gr.Markdown("*India's First Solo-Built AI - Founded by Devanshu Sharma (Hermes), Age 18, Neem Ka Thana, Rajasthan*")
78
 
79
  with gr.Tab("๐Ÿ’ฌ Chat"):
80
- with gr.Row():
81
- with gr.Column(scale=3):
82
- chat_input = gr.Textbox(
83
- label="Your Message",
84
- placeholder="Type your message here...",
85
- lines=3
86
- )
87
-
88
- model_select = gr.Dropdown(
89
- choices=[
90
- "Devrayog Agni (Fast)",
91
- "Devrayog Vayu (Creative)",
92
- "Devrayog Akash (Powerful)"
93
- ],
94
- value="Devrayog Agni (Fast)",
95
- label="Select Model"
96
- )
97
-
98
- system_prompt_input = gr.Textbox(
99
- label="System Prompt (Optional)",
100
- placeholder="Set a custom system prompt...",
101
- lines=2
102
- )
103
-
104
- chat_btn = gr.Button("Send ๐Ÿš€", variant="primary")
105
-
106
- with gr.Column(scale=2):
107
- chat_output = gr.Textbox(
108
- label="Response",
109
- lines=10,
110
- interactive=False
111
- )
112
-
113
- chat_btn.click(
114
- fn=chat_with_devrayog,
115
- inputs=[chat_input, model_select, system_prompt_input],
116
- outputs=chat_output
117
  )
 
 
 
 
 
118
 
119
- with gr.Tab("๐Ÿ“š Model Info"):
120
  gr.Markdown(get_model_info())
121
 
122
  with gr.Tab("๐ŸŽฏ SSB Prep"):
123
  gr.Markdown("""
124
  ## SSB Interview Preparation
125
 
126
- ### 5-Day SSB Process
127
- 1. **Day 1 - Screening:** OIR Test + PPDT
128
- 2. **Day 2 - Psychology:** TAT, WAT, SRT, SD
129
- 3. **Day 3-4 - GTO Tasks:** GD, GPE, PGT, HGT, Command Task, FGT
130
- 4. **Day 5 - Conference:** Final Result
131
-
132
- ### 15 Officer-Like Qualities (OLQs)
133
- 1. Effective Intelligence
134
- 2. Reasoning Ability
135
- 3. Organizing Ability
136
- 4. Power of Expression
137
- 5. Social Adaptability
138
- 6. Cooperation
139
- 7. Sense of Responsibility
140
- 8. Initiative
141
- 9. Self Confidence
142
- 10. Speed of Decision
143
- 11. Ability to Influence the Group
144
- 12. Liveliness
145
- 13. Determination
146
- 14. Courage
147
- 15. Stamina
148
 
149
  ### Quick Tips
150
  - Be yourself, don't fake
@@ -152,7 +84,6 @@ with gr.Blocks(
152
  - Write 6 TAT stories daily
153
  - Stay updated with current affairs
154
  - Maintain physical fitness
155
- - Be confident but humble
156
  """)
157
 
158
  with gr.Tab("โ„น๏ธ About"):
@@ -169,15 +100,13 @@ To build India's most accessible and powerful AI, created by a young Indian foun
169
  - **Devrayog Vayu** - Creative and flowing (9B)
170
  - **Devrayog Akash** - Most powerful (8B)
171
 
172
- ### Contact
173
  - Hugging Face: https://huggingface.co/dev2089
174
- - Founder: Devanshu Sharma (Hermes)
175
 
176
  ---
177
-
178
  *Built with โค๏ธ in India ๐Ÿ‡ฎ๐Ÿ‡ณ*
179
  """)
180
 
181
- # Launch the app
182
  if __name__ == "__main__":
183
  demo.launch(server_name="0.0.0.0", server_port=7860)
 
4
  """
5
 
6
  import gradio as gr
 
7
  import json
 
8
  import time
9
 
 
 
 
10
  def chat_with_devrayog(message, model_name, system_prompt):
11
+ """Send chat request to Devrayog AI"""
12
 
13
  if not message.strip():
14
  return "Please enter a message."
15
 
 
 
 
16
  model_responses = {
17
+ "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?",
18
 
19
+ "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!",
20
 
21
+ "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."
22
  }
23
 
24
  response = model_responses.get(model_name, model_responses["Devrayog Agni (Fast)"])
 
29
  return response
30
 
31
  def get_model_info():
 
32
  return """
33
  ## Devrayog AI Models
34
 
35
+ ### ๐Ÿ”ฅ Devrayog Agni (Fast) - 3.8B parameters
36
+ Best for: Quick responses, coding, daily tasks
 
 
37
 
38
+ ### ๐ŸŒŠ Devrayog Vayu (Creative) - 9B parameters
39
+ Best for: Storytelling, brainstorming, content generation
 
 
40
 
41
+ ### ๐ŸŒŒ Devrayog Akash (Powerful) - 8B parameters
42
+ Best for: Complex reasoning, analysis, research
 
 
43
 
44
  ---
 
45
  **Founder:** Devanshu Sharma (Hermes), Age 18, Neem Ka Thana, Rajasthan
 
46
  **Tagline:** India's First Solo-Built AI
47
  """
48
 
49
  # Create Gradio interface
50
+ with gr.Blocks(title="Devrayog AI") as demo:
 
 
 
 
 
 
 
51
 
52
+ gr.Markdown("# ๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI")
53
+ gr.Markdown("*India's First Solo-Built AI - Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan*")
54
 
55
  with gr.Tab("๐Ÿ’ฌ Chat"):
56
+ chat_input = gr.Textbox(label="Your Message", placeholder="Type your message here...", lines=3)
57
+ model_select = gr.Dropdown(
58
+ choices=["Devrayog Agni (Fast)", "Devrayog Vayu (Creative)", "Devrayog Akash (Powerful)"],
59
+ value="Devrayog Agni (Fast)",
60
+ label="Select Model"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
61
  )
62
+ system_prompt_input = gr.Textbox(label="System Prompt (Optional)", placeholder="Set a custom system prompt...", lines=2)
63
+ chat_btn = gr.Button("Send ๐Ÿš€", variant="primary")
64
+ chat_output = gr.Textbox(label="Response", lines=10, interactive=False)
65
+
66
+ chat_btn.click(fn=chat_with_devrayog, inputs=[chat_input, model_select, system_prompt_input], outputs=chat_output)
67
 
68
+ with gr.Tab("๐Ÿ“š Models"):
69
  gr.Markdown(get_model_info())
70
 
71
  with gr.Tab("๐ŸŽฏ SSB Prep"):
72
  gr.Markdown("""
73
  ## SSB Interview Preparation
74
 
75
+ ### 5-Day Process
76
+ - **Day 1:** Screening (OIR + PPDT)
77
+ - **Day 2:** Psychology (TAT, WAT, SRT, SD)
78
+ - **Day 3-4:** GTO Tasks (GD, GPE, PGT, HGT, Command Task, FGT)
79
+ - **Day 5:** Conference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
80
 
81
  ### Quick Tips
82
  - Be yourself, don't fake
 
84
  - Write 6 TAT stories daily
85
  - Stay updated with current affairs
86
  - Maintain physical fitness
 
87
  """)
88
 
89
  with gr.Tab("โ„น๏ธ About"):
 
100
  - **Devrayog Vayu** - Creative and flowing (9B)
101
  - **Devrayog Akash** - Most powerful (8B)
102
 
103
+ ### Links
104
  - Hugging Face: https://huggingface.co/dev2089
105
+ - Founder: Devanshu Sharma (Hermes), Age 18, Rajasthan
106
 
107
  ---
 
108
  *Built with โค๏ธ in India ๐Ÿ‡ฎ๐Ÿ‡ณ*
109
  """)
110
 
 
111
  if __name__ == "__main__":
112
  demo.launch(server_name="0.0.0.0", server_port=7860)