Spaces:
Running
Running
Upload app.py with huggingface_hub
Browse files92 unmodified lines939495969798991001011021031041051069 unmodified lines11611711811912012112218 unmodified lines14114214314414514614714851 unmodified lines20020120220320420520692 unmodified lines# Add model-specific flairif "Creative" in model_name:response = response + "\n\n🌟 *Crafted with creativity by Devrayog Vayu*"elif "Powerful" in model_name:response = response + "\n\n🔬 *Deep analysis by Devrayog Akash*"else:response = response + "\n\n⚡ *Quick response by Devrayog Agni*"chat_history.append({"role": "user", "content": message})chat_history.append({"role": "assistant", "content": 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:# Headergr.HTML("""18 unmodified lineslabel="Chat with Devrayog AI",height=400,show_label=False,elem_classes=["chat-container"],type="messages")# Input row51 unmodified linessend_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 buttonsbtn_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])92 unmodified lines939495969798991001011021031041059 unmodified lines11511611711811912012118 unmodified lines14014114214314414514651 unmodified lines19819920020120220320492 unmodified lines# Add model-specific flairif "Creative" in model_name:response = response + "\n\n🌟 Crafted with creativity by Devrayog Vayu"elif "Powerful" in model_name:response = response + "\n\n🔬 Deep analysis by Devrayog Akash"else:response = response + "\n\n⚡ Quick response by Devrayog Agni"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") as demo:# Headergr.HTML("""18 unmodified lineslabel="Chat with Devrayog AI",height=400,show_label=False,elem_classes=["chat-container"])# Input row51 unmodified linessend_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 buttonsbtn_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