Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -1,231 +1,210 @@
|
|
| 1 |
-
"""
|
| 2 |
-
Devrayog AI -
|
| 3 |
-
|
| 4 |
-
"""
|
| 5 |
-
|
| 6 |
-
import gradio as gr
|
| 7 |
-
import
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
"
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
"
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
def
|
| 31 |
-
"""
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
"
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
return "
|
| 68 |
-
|
| 69 |
-
return
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
# Get
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
.
|
| 110 |
-
.
|
| 111 |
-
.
|
| 112 |
-
.
|
| 113 |
-
.
|
| 114 |
-
.
|
| 115 |
-
.
|
| 116 |
-
.
|
| 117 |
-
"""
|
| 118 |
-
|
| 119 |
-
with gr.Blocks(title="Devrayog AI", css=
|
| 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=
|
| 134 |
-
value="Devrayog Agni (Fast)",
|
| 135 |
-
label="Select Model",
|
| 136 |
-
interactive=True
|
| 137 |
-
)
|
| 138 |
-
|
| 139 |
-
#
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
#
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
)
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
with gr.Column(scale=1):
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
### ๐ฏ
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
#
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 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)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|