Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files92 unmodified lines9394959696979898991001001011021031021031041059 unmodified lines11511611711911811912012118 unmodified lines14014114214414514314414514651 unmodified lines19819920020320120220320492 unmodified lines
# Add model-specific flair
if "Creative" in model_name:
response = response + "\n\n🌟 *Crafted with creativity by Devrayog Vayu*"
response = response + "\n\n🌟 Crafted with creativity by Devrayog Vayu"
elif "Powerful" in model_name:
response = response + "\n\n🔬 *Deep analysis by Devrayog Akash*"
response = response + "\n\n🔬 Deep analysis by Devrayog Akash"
else:
response = response + "\n\n⚡ *Quick response by Devrayog Agni*"
response = response + "\n\n⚡ Quick response by Devrayog Agni"
chat_history.append({"role": "user", "content": message})
chat_history.append({"role": "assistant", "content": prefix + response})
chat_history.append((message, prefix + response))
return chat_history, ""
9 unmodified lines.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;}
"""
with gr.Blocks(title="Devrayog AI", css=css) as demo:
with gr.Blocks(title="Devrayog AI") as demo:
# Header
gr.HTML("""18 unmodified lines label="Chat with Devrayog AI",
height=400,
show_label=False,
elem_classes=["chat-container"],
type="messages"
elem_classes=["chat-container"]
)
# Input row51 unmodified lines send_btn.click(fn=chat, inputs=[msg_input, model_select, chatbot], outputs=[chatbot, msg_input])
msg_input.submit(fn=chat, inputs=[msg_input, model_select, chatbot], outputs=[chatbot, msg_input])
# Quick buttons
# Quick buttons
btn_ssb.click(fn=lambda h: chat("What is the SSB interview process?", "Devrayog Agni (Fast)", h), inputs=[chatbot], outputs=[chatbot, msg_input])
btn_tat.click(fn=lambda h: chat("How to prepare for TAT?", "Devrayog Vayu (Creative)", h), inputs=[chatbot], outputs=[chatbot, msg_input])
btn_nda.click(fn=lambda h: chat("What is NDA exam?", "Devrayog Akash (Powerful)", h), inputs=[chatbot], outputs=[chatbot, msg_input])app.py+7-9