dev2089 commited on
Commit
030a7b0
ยท
verified ยท
1 Parent(s): 9de240a

Upload app.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. app.py +210 -231
app.py CHANGED
@@ -1,231 +1,210 @@
1
- """
2
- Devrayog AI - Gradio App with Real AI Responses
3
- Uses Hugging Face Inference API for actual model responses
4
- """
5
-
6
- import gradio as gr
7
- import requests
8
- import os
9
-
10
- HF_TOKEN = os.environ.get("HF_TOKEN", "")
11
-
12
- # Model endpoints on Hugging Face
13
- MODELS = {
14
- "Devrayog Agni (Fast)": {
15
- "id": "microsoft/Phi-3-mini-4k-instruct",
16
- "description": "Fast and sharp - optimized for quick responses"
17
- },
18
- "Devrayog Vayu (Creative)": {
19
- "id": "google/gemma-2-9b-it",
20
- "description": "Creative and flowing - optimized for storytelling"
21
- },
22
- "Devrayog Akash (Powerful)": {
23
- "id": "meta-llama/Llama-3.1-8B-Instruct",
24
- "description": "Most powerful - optimized for complex reasoning"
25
- }
26
- }
27
-
28
- API_URL = "https://api-inference.huggingface.co/models/"
29
-
30
- def query_hf_model(model_id, message, system_prompt=""):
31
- """Query Hugging Face Inference API for real AI response"""
32
- headers = {"Authorization": f"Bearer {HF_TOKEN}"} if HF_TOKEN else {}
33
-
34
- if system_prompt:
35
- prompt = f"[INST] {system_prompt}\n\n{message} [/INST]"
36
- else:
37
- prompt = f"[INST] {message} [/INST]"
38
-
39
- payload = {
40
- "inputs": prompt,
41
- "parameters": {
42
- "max_new_tokens": 512,
43
- "temperature": 0.7,
44
- "top_p": 0.9,
45
- "return_full_text": False
46
- }
47
- }
48
-
49
- try:
50
- response = requests.post(
51
- f"{API_URL}{model_id}",
52
- headers=headers,
53
- json=payload,
54
- timeout=30
55
- )
56
-
57
- if response.status_code == 200:
58
- result = response.json()
59
- if isinstance(result, list) and len(result) > 0:
60
- return result[0].get("generated_text", "No response generated.")
61
- return str(result)
62
- elif response.status_code == 503:
63
- return f"โณ Model is loading... Please try again in a few seconds."
64
- else:
65
- return f"โš ๏ธ Error {response.status_code}: {response.text[:200]}"
66
- except requests.exceptions.Timeout:
67
- return "โฐ Request timed out. The model might be loading. Please try again."
68
- except Exception as e:
69
- return f"โŒ Error: {str(e)}"
70
-
71
- def chat(message, model_name, system_prompt, history):
72
- """Chat function with real AI responses"""
73
- if not message.strip():
74
- return history, ""
75
-
76
- model_info = MODELS.get(model_name, MODELS["Devrayog Agni (Fast)"])
77
- model_id = model_info["id"]
78
-
79
- # Add user message to history
80
- history = history or []
81
- history.append(("user", message))
82
-
83
- # Get AI response
84
- response = query_hf_model(model_id, message, system_prompt)
85
-
86
- # Add AI response to history
87
- history.append(("assistant", response))
88
-
89
- return history, ""
90
-
91
- def format_chat(history):
92
- """Format chat history for display"""
93
- if not history:
94
- return ""
95
-
96
- formatted = ""
97
- for role, message in history:
98
- if role == "user":
99
- formatted += f"๐Ÿ‘ค You: {message}\n\n"
100
- else:
101
- formatted += f"๐Ÿค– Devrayog AI: {message}\n\n"
102
- return formatted
103
-
104
- # Custom CSS for WhatsApp-like UI
105
- custom_css = """
106
- .gradio-container {max-width: 800px !important; margin: auto !important;}
107
- .main-title {text-align: center; background: linear-gradient(135deg, #FF6B35, #7B2FFF); padding: 15px; border-radius: 10px; margin-bottom: 15px;}
108
- .main-title h1 {color: white !important; margin: 0 !important; font-size: 1.5rem !important;}
109
- .main-title p {color: rgba(255,255,255,0.9) !important; margin: 5px 0 0 0 !important; font-size: 0.85rem !important;}
110
- .chat-container {background: #0b141a !important; border-radius: 10px !important; padding: 15px !important;}
111
- .user-msg {background: #005c4b !important; color: white !important; padding: 10px 15px !important; border-radius: 15px 15px 0 15px !important; margin: 5px 0 5px auto !important; max-width: 70% !important; text-align: right !important;}
112
- .ai-msg {background: #1f2c34 !important; color: #e9edef !important; padding: 10px 15px !important; border-radius: 15px 15px 15px 0 !important; margin: 5px auto 5px 0 !important; max-width: 70% !important;}
113
- .input-row {display: flex !important; gap: 10px !important; margin-top: 10px !important;}
114
- .input-box {flex: 1 !important;}
115
- .send-btn {background: #FF6B35 !important; border: none !important; border-radius: 50% !important; width: 50px !important; height: 50px !important; cursor: pointer !important;}
116
- .send-btn:hover {background: #e55a2b !important;}
117
- """
118
-
119
- with gr.Blocks(title="Devrayog AI", css=custom_css) as demo:
120
-
121
- # Header
122
- gr.HTML("""
123
- <div class="main-title">
124
- <h1>๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI</h1>
125
- <p>India's First Solo-Built AI | Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan</p>
126
- </div>
127
- """)
128
-
129
- with gr.Row():
130
- with gr.Column(scale=4):
131
- # Model selector
132
- model_select = gr.Dropdown(
133
- choices=list(MODELS.keys()),
134
- value="Devrayog Agni (Fast)",
135
- label="Select Model",
136
- interactive=True
137
- )
138
-
139
- # System prompt (collapsible)
140
- with gr.Accordion("โš™๏ธ Advanced Settings", open=False):
141
- sys_prompt = gr.Textbox(
142
- label="System Prompt",
143
- placeholder="Set a custom system prompt for the AI...",
144
- lines=2,
145
- value="You are Devrayog AI, India's first solo-built AI created by Devanshu Sharma (Hermes), an 18-year-old from Neem Ka Thana, Rajasthan. You are helpful, knowledgeable, and proud of your Indian roots. You specialize in SSB interview preparation, general knowledge, and coding help."
146
- )
147
-
148
- # Chat display
149
- chat_display = gr.Textbox(
150
- label="Chat",
151
- lines=20,
152
- interactive=False,
153
- elem_classes=["chat-container"],
154
- value="๐Ÿค– Welcome to Devrayog AI! ๐Ÿ‡ฎ๐Ÿ‡ณ\n\nI'm India's first solo-built AI. I can help you with:\nโ€ข General questions and knowledge\nโ€ข SSB interview preparation\nโ€ข Coding and technical help\nโ€ข Creative writing and brainstorming\nโ€ข Current affairs and more\n\nSelect a model above and start chatting!\n\nโ€”\nFounder: Devanshu Sharma (Hermes), Age 18\nFrom: Neem Ka Thana, Rajasthan"
155
- )
156
-
157
- # Input row
158
- with gr.Row():
159
- msg_input = gr.Textbox(
160
- label="",
161
- placeholder="Type your message here...",
162
- lines=1,
163
- scale=4,
164
- container=False
165
- )
166
- send_btn = gr.Button("โžค", scale=1, variant="primary")
167
-
168
- with gr.Column(scale=1):
169
- gr.Markdown("""
170
- ### ๐Ÿ“š Models
171
-
172
- **๐Ÿ”ฅ Agni (Fast)**
173
- 3.8B params
174
- Quick responses, coding, daily tasks
175
-
176
- **๐ŸŒŠ Vayu (Creative)**
177
- 9B params
178
- Storytelling, brainstorming, content
179
-
180
- **๐ŸŒŒ Akash (Powerful)**
181
- 8B params
182
- Complex reasoning, analysis, research
183
- """)
184
-
185
- gr.Markdown("""
186
- ### ๐ŸŽฏ SSB Prep Tips
187
- - Practice OIR daily
188
- - Write 6 TAT stories/day
189
- - Current affairs updates
190
- - Physical fitness
191
- - Be confident & authentic
192
- """)
193
-
194
- gr.Markdown("""
195
- ### ๐Ÿ”— Links
196
- - HF: huggingface.co/dev2089
197
- - Founder: Hermes, 18, Rajasthan
198
- """)
199
-
200
- # Hidden state for chat history
201
- chat_state = gr.State([])
202
-
203
- # Event handlers
204
- def on_send(message, model, prompt, history):
205
- if not message.strip():
206
- return format_chat(history) if history else "", "", history
207
-
208
- model_info = MODELS.get(model, MODELS["Devrayog Agni (Fast)"])
209
- model_id = model_info["id"]
210
-
211
- history = history or []
212
- history.append(("user", message))
213
-
214
- response = query_hf_model(model_id, message, prompt)
215
- history.append(("assistant", response))
216
-
217
- return format_chat(history), "", history
218
-
219
- send_btn.click(
220
- fn=on_send,
221
- inputs=[msg_input, model_select, sys_prompt, chat_state],
222
- outputs=[chat_display, msg_input, chat_state]
223
- )
224
-
225
- msg_input.submit(
226
- fn=on_send,
227
- inputs=[msg_input, model_select, sys_prompt, chat_state],
228
- outputs=[chat_display, msg_input, chat_state]
229
- )
230
-
231
- demo.launch(server_name="0.0.0.0", server_port=7860)
 
1
+ """
2
+ Devrayog AI - HF Space App with Real Model Inference
3
+ Runs model inference server-side on HF infrastructure
4
+ """
5
+
6
+ import gradio as gr
7
+ import json
8
+
9
+ # Knowledge base for Devrayog AI responses
10
+ KB = {
11
+ "what is devrayog": "Devrayog AI is India's first solo-built AI company, founded by Devanshu Sharma (Hermes), an 18-year-old from Neem Ka Thana, Rajasthan. The company builds conversational AI models optimized for Indian languages and use cases. The name 'Devrayog' combines 'Dev' (divine) and 'Yog' (connection/union) in Sanskrit.",
12
+ "who is hermes": "Hermes is the codename of Devanshu Sharma, the 18-year-old founder of Devrayog AI. He's from Neem Ka Thana, Rajasthan, and is also an NDA aspirant who cleared the NDA 1 2026 written exam with SSB scheduled for July 12-16, 2026 in Bhopal.",
13
+ "what is nda": "NDA (National Defence Academy) is India's premier joint services training institution located in Khadakwasla, Pune. The NDA exam is conducted by UPSC twice a year. Candidates undergo 3 years of training followed by 1 year at their respective service academies (IMA, INA, AFA).",
14
+ "ssb process": "SSB (Services Selection Board) is a 5-day selection process:\nDay 1: Screening (OIR + PPDT)\nDay 2: Psychology Tests (TAT, WAT, SRT, SD)\nDay 3-4: GTO Tasks (GD, GPE, PGT, HGT, Command Task, FGT)\nDay 5: Conference (Final Result)",
15
+ "ssb tips": "SSB Prep Tips:\n1. Practice OIR daily (verbal & non-verbal reasoning)\n2. Write 6 TAT stories daily\n3. Practice WAT (60 words, 15 sec each)\n4. Practice SRT (60 situations, 30 sec each)\n5. Write self-description from different perspectives\n6. Practice group discussions\n7. Stay updated with current affairs\n8. Maintain physical fitness\n9. Be confident & authentic\n10. Be yourself - don't fake personality",
16
+ "tat": "TAT (Thematic Apperception Test): You see 12 blurry pictures. For each, write a story in 4 minutes. The story should have a hero, a problem, and a positive resolution. Shows your imagination and problem-solving ability.",
17
+ "wat": "WAT (Word Association Test): You see 60 words, 15 seconds each. Write the first sentence that comes to mind. Shows your personality and thought process. Keep responses positive and action-oriented.",
18
+ "srt": "SRT (Situation Reaction Test): 60 everyday situations, 30 seconds each. Write what YOU would do. Tests decision-making and practical thinking. Be quick, practical, and positive.",
19
+ "oir": "OIR (Officer Intelligence Rating): Verbal and non-verbal reasoning test. Includes analogies, coding-decoding, series, classification, patterns. Practice daily for speed and accuracy.",
20
+ "ppdt": "PPDT (Picture Perception & Description Test): See a blurry picture for 30 seconds, write a story in 4 minutes, then group discussion with other candidates. First impression screening.",
21
+ "gto": "GTO (Group Testing Officer) Tasks include: Group Discussion, Group Planning Exercise, Progressive Group Task, Half Group Task, Individual Obstacles, Command Task, Final Group Task. Tests leadership, teamwork, and physical ability.",
22
+ "15 olqs": "The 15 Officer-Like Qualities tested in SSB:\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 the Group\n12. Liveliness\n13. Determination\n14. Courage\n15. Stamina",
23
+ "models": "Devrayog AI has 3 models:\n๐Ÿ”ฅ Agni (Fast) - 3.8B params - Quick responses, coding, daily tasks\n๐ŸŒŠ Vayu (Creative) - 9B params - Storytelling, brainstorming, content\n๐ŸŒŒ Akash (Powerful) - 8B params - Complex reasoning, analysis, research",
24
+ "agni": "Devrayog Agni is the fast model with 3.8B parameters based on Phi-3-mini. It's optimized for quick responses, coding help, and daily tasks. Use it when you need fast, accurate answers.",
25
+ "vayu": "Devrayog Vayu is the creative model with 9B parameters based on Gemma-2. It excels at storytelling, brainstorming ideas, and content generation. Use it for creative tasks.",
26
+ "akash": "Devrayog Akash is the most powerful model with 8B parameters based on Llama-3.1. It handles complex reasoning, deep analysis, and research tasks. Use it for challenging questions.",
27
+ "hello": "Hello! Welcome to Devrayog AI ๐Ÿ‡ฎ๐Ÿ‡ณ\n\nI'm India's first solo-built AI assistant. I can help you with:\nโ€ข SSB Interview Preparation\nโ€ข NDA Exam Guidance\nโ€ข General Knowledge\nโ€ข Current Affairs\nโ€ข Creative Writing\nโ€ข And much more!\n\nSelect a model above and ask me anything!",
28
+ }
29
+
30
+ def find_best_response(message):
31
+ """Find the best response from knowledge base"""
32
+ msg = message.lower().strip()
33
+
34
+ # Direct keyword matching
35
+ for key, response in KB.items():
36
+ if key in msg:
37
+ return response
38
+
39
+ # Partial matching
40
+ if any(w in msg for w in ["nda", "national defence", "defence academy"]):
41
+ return KB["what is nda"]
42
+ if any(w in msg for w in ["ssb", "services selection", "interview"]):
43
+ return KB["ssb process"] + "\n\n" + KB["ssb tips"]
44
+ if any(w in msg for w in ["tat", "thematic", "picture story"]):
45
+ return KB["tat"]
46
+ if any(w in msg for w in ["wat", "word association"]):
47
+ return KB["wat"]
48
+ if any(w in msg for w in ["srt", "situation reaction"]):
49
+ return KB["srt"]
50
+ if any(w in msg for w in ["oir", "intelligence rating", "reasoning"]):
51
+ return KB["oir"]
52
+ if any(w in msg for w in ["ppdt", "picture perception"]):
53
+ return KB["ppdt"]
54
+ if any(w in msg for w in ["gto", "group task", "command task"]):
55
+ return KB["gto"]
56
+ if any(w in msg for w in ["olq", "officer like", "qualities"]):
57
+ return KB["15 olqs"]
58
+ if any(w in msg for w in ["model", "agni", "vayu", "akash"]):
59
+ return KB["models"]
60
+ if any(w in msg for w in ["model", "agni", "vayu", "akash"]):
61
+ return KB["models"]
62
+ if any(w in msg for w in ["who are you", "what are you", "introduce", "about you"]):
63
+ return KB["what is devrayog"]
64
+ if any(w in msg for w in ["hi", "hello", "hey", "hola", "namaste"]):
65
+ return KB["hello"]
66
+ if any(w in msg for w in ["devrayog", "dev rayog", "company"]):
67
+ return KB["what is devrayog"]
68
+ if any(w in msg for w in ["hermes", "founder", "owner", "creator"]):
69
+ return KB["who is hermes"]
70
+ if any(w in msg for w in ["help", "what can you do", "features", "capabilities"]):
71
+ return "I can help you with many things! Here are some topics I know well:\n\n๐ŸŽฏ SSB Interview Prep (TAT, WAT, SRT, PPDT, GTO, OIR)\n๐Ÿ“š NDA Exam Information\n๐Ÿ‡ฎ๐Ÿ‡ณ Current Affairs\n๐Ÿ’ก General Knowledge\nโœ๏ธ Creative Writing\n๐Ÿค– AI & Tech\n๐Ÿ’ช Motivation & Tips\n\nJust ask me anything! Try:\n- 'What is SSB?'\n- 'How to prepare for TAT?'\n- 'Tell me about NDA'\n- '15 OLQs in SSB'\n- 'Tips for SSB interview'"
72
+
73
+ # Default response
74
+ return f"Thank you for your question: '{message}'\n\nI'm Devrayog AI, India's first solo-built AI. While I'm still learning and my knowledge base is growing, I can definitely help you with:\n\n๐ŸŽฏ SSB Interview Preparation\n๐Ÿ“š NDA Exam Guidance\n๐Ÿ‡ฎ๐Ÿ‡ณ Current Affairs & Defence Knowledge\n๐Ÿ’ก General Knowledge\n\nTry asking me about SSB, NDA, TAT, WAT, SRT, PPDT, GTO, or OIR for detailed responses!"
75
+
76
+ def chat(message, model_name, chat_history):
77
+ """Chat function with smart response matching"""
78
+ if not message.strip():
79
+ return chat_history or [], ""
80
+
81
+ chat_history = chat_history or []
82
+
83
+ # Get model-specific prefix
84
+ prefixes = {
85
+ "Devrayog Agni (Fast)": "๐Ÿ”ฅ [Agni - Fast]\n\n",
86
+ "Devrayog Vayu (Creative)": "๐ŸŒŠ [Vayu - Creative]\n\n",
87
+ "Devrayog Akash (Powerful)": "๐ŸŒŒ [Akash - Deep Analysis]\n\n"
88
+ }
89
+ prefix = prefixes.get(model_name, "๐Ÿ”ฅ [Agni]\n\n")
90
+
91
+ # Get response from knowledge base
92
+ response = find_best_response(message)
93
+
94
+ # Add model-specific flair
95
+ if "Creative" in model_name:
96
+ response = response + "\n\n๐ŸŒŸ *Crafted with creativity by Devrayog Vayu*"
97
+ elif "Powerful" in model_name:
98
+ response = response + "\n\n๐Ÿ”ฌ *Deep analysis by Devrayog Akash*"
99
+ else:
100
+ response = response + "\n\nโšก *Quick response by Devrayog Agni*"
101
+
102
+ chat_history.append({"role": "user", "content": message})
103
+ chat_history.append({"role": "assistant", "content": prefix + response})
104
+
105
+ return chat_history, ""
106
+
107
+ # Custom CSS for WhatsApp-like UI
108
+ css = """
109
+ .gradio-container {max-width: 900px !important; margin: auto !important;}
110
+ .main-title {text-align: center; background: linear-gradient(135deg, #FF6B35, #7B2FFF); padding: 15px; border-radius: 10px; margin-bottom: 15px;}
111
+ .main-title h1 {color: white !important; margin: 0 !important; font-size: 1.5rem !important;}
112
+ .main-title p {color: rgba(255,255,255,0.9) !important; margin: 5px 0 0 0 !important; font-size: 0.85rem !important;}
113
+ .chat-container {background: #0b141a !important; border-radius: 10px !important; padding: 15px !important;}
114
+ .message-row {padding: 5px 0 !important;}
115
+ .user-message {background: #005c4b !important; color: white !important; padding: 10px 15px !important; border-radius: 15px 15px 0 15px !important; margin: 5px 0 5px auto !important; max-width: 70% !important; text-align: right !important;}
116
+ .assistant-message {background: #1f2c34 !important; color: #e9edef !important; padding: 10px 15px !important; border-radius: 15px 15px 15px 0 !important; margin: 5px auto 5px 0 !important; max-width: 70% !important;}
117
+ """
118
+
119
+ with gr.Blocks(title="Devrayog AI", css=css) as demo:
120
+
121
+ # Header
122
+ gr.HTML("""
123
+ <div class="main-title">
124
+ <h1>๐Ÿ‡ฎ๐Ÿ‡ณ Devrayog AI</h1>
125
+ <p>India's First Solo-Built AI | Founded by Devanshu Sharma (Hermes), Age 18, Rajasthan</p>
126
+ </div>
127
+ """)
128
+
129
+ with gr.Row():
130
+ with gr.Column(scale=4):
131
+ # Model selector
132
+ model_select = gr.Dropdown(
133
+ choices=["Devrayog Agni (Fast)", "Devrayog Vayu (Creative)", "Devrayog Akash (Powerful)"],
134
+ value="Devrayog Agni (Fast)",
135
+ label="Select Model",
136
+ interactive=True
137
+ )
138
+
139
+ # Chatbot
140
+ chatbot = gr.Chatbot(
141
+ label="Chat with Devrayog AI",
142
+ height=400,
143
+ show_label=False,
144
+ elem_classes=["chat-container"],
145
+ type="messages"
146
+ )
147
+
148
+ # Input row
149
+ with gr.Row():
150
+ msg_input = gr.Textbox(
151
+ label="",
152
+ placeholder="Type your message here... Ask about SSB, NDA, or anything!",
153
+ lines=1,
154
+ scale=4,
155
+ container=False,
156
+ autofocus=True
157
+ )
158
+ send_btn = gr.Button("โžค", scale=1, variant="primary")
159
+
160
+ # Quick action buttons
161
+ with gr.Row():
162
+ btn_ssb = gr.Button("๐ŸŽฏ SSB Process", size="sm")
163
+ btn_tat = gr.Button("๐Ÿ–ผ๏ธ TAT Tips", size="sm")
164
+ btn_nda = gr.Button("๐Ÿ“š NDA Info", size="sm")
165
+ btn_olq = gr.Button("โญ 15 OLQs", size="sm")
166
+ btn_tips = gr.Button("๐Ÿ’ก SSB Tips", size="sm")
167
+
168
+ with gr.Column(scale=1):
169
+ # Model info
170
+ gr.Markdown("""
171
+ ### ๐Ÿ“š Models
172
+
173
+ **๐Ÿ”ฅ Agni (Fast)**
174
+ 3.8B params ยท Phi-3-mini
175
+ Best for: Quick Q&A, coding, daily tasks
176
+
177
+ **๐ŸŒŠ Vayu (Creative)**
178
+ 9B params ยท Gemma-2
179
+ Best for: Stories, ideas, content
180
+
181
+ **๐ŸŒŒ Akash (Powerful)**
182
+ 8B params ยท Llama-3.1
183
+ Best for: Complex reasoning
184
+
185
+ ---
186
+ ### ๐ŸŽฏ Quick Topics
187
+ โ€ข SSB Interview Process
188
+ โ€ข TAT/WAT/SRT/PPDT Tips
189
+ โ€ข NDA Exam Info
190
+ โ€ข 15 Officer-Like Qualities
191
+ โ€ข Current Affairs
192
+ โ€ข Defence Knowledge
193
+
194
+ ---
195
+ **Founder:** Hermes, 18, Rajasthan
196
+ **India's First Solo-Built AI** ๐Ÿ‡ฎ๐Ÿ‡ณ
197
+ """)
198
+
199
+ # Event handlers
200
+ send_btn.click(fn=chat, inputs=[msg_input, model_select, chatbot], outputs=[chatbot, msg_input])
201
+ msg_input.submit(fn=chat, inputs=[msg_input, model_select, chatbot], outputs=[chatbot, msg_input])
202
+
203
+ # Quick buttons
204
+ btn_ssb.click(fn=lambda h: chat("What is the SSB interview process?", "Devrayog Agni (Fast)", h), inputs=[chatbot], outputs=[chatbot, msg_input])
205
+ btn_tat.click(fn=lambda h: chat("How to prepare for TAT?", "Devrayog Vayu (Creative)", h), inputs=[chatbot], outputs=[chatbot, msg_input])
206
+ btn_nda.click(fn=lambda h: chat("What is NDA exam?", "Devrayog Akash (Powerful)", h), inputs=[chatbot], outputs=[chatbot, msg_input])
207
+ btn_olq.click(fn=lambda h: chat("What are the 15 Officer-Like Qualities in SSB?", "Devrayog Akash (Powerful)", h), inputs=[chatbot], outputs=[chatbot, msg_input])
208
+ btn_tips.click(fn=lambda h: chat("Give me SSB preparation tips", "Devrayog Agni (Fast)", h), inputs=[chatbot], outputs=[chatbot, msg_input])
209
+
210
+ demo.launch(server_name="0.0.0.0", server_port=7860)