Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -58,10 +58,42 @@ def chatbot(user_input):
|
|
| 58 |
return output
|
| 59 |
|
| 60 |
# Gradio UI with chat history
|
| 61 |
-
with gr.Blocks() as demo:
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
|
| 66 |
def respond(user_message, chat_history):
|
| 67 |
chat_history = chat_history or []
|
|
|
|
| 58 |
return output
|
| 59 |
|
| 60 |
# Gradio UI with chat history
|
| 61 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 62 |
+
gr.HTML("""
|
| 63 |
+
<style>
|
| 64 |
+
body, .gr-block, .gr-button, .gr-textbox, .gr-chatbot {
|
| 65 |
+
font-family: 'Times New Roman', Times, serif !important;
|
| 66 |
+
font-size: 16px;
|
| 67 |
+
}
|
| 68 |
+
</style>
|
| 69 |
+
""")
|
| 70 |
+
# Header and description
|
| 71 |
+
gr.Markdown(
|
| 72 |
+
"""
|
| 73 |
+
# Smart AI Assistant
|
| 74 |
+
Powered by **GPT + Real-time Search**.
|
| 75 |
+
* By - **Manoj Anuragi**
|
| 76 |
+
""",
|
| 77 |
+
elem_id="header"
|
| 78 |
+
)
|
| 79 |
+
|
| 80 |
+
with gr.Row():
|
| 81 |
+
chatbot_ui = gr.Chatbot(
|
| 82 |
+
type="messages",
|
| 83 |
+
autoscroll=True,
|
| 84 |
+
height=450,
|
| 85 |
+
show_label=False
|
| 86 |
+
)
|
| 87 |
+
|
| 88 |
+
with gr.Row():
|
| 89 |
+
user_input = gr.Textbox(
|
| 90 |
+
placeholder="Ask me anything...",
|
| 91 |
+
show_label=False,
|
| 92 |
+
scale=10,
|
| 93 |
+
|
| 94 |
+
autofocus=True
|
| 95 |
+
)
|
| 96 |
+
submit = gr.Button(" ➡️ Ask", scale=2)
|
| 97 |
|
| 98 |
def respond(user_message, chat_history):
|
| 99 |
chat_history = chat_history or []
|