Update app.py
Browse files
app.py
CHANGED
|
@@ -26,24 +26,42 @@ def create_chat_interface():
|
|
| 26 |
chatbot_component = gr.Chatbot(type="messages", label="Chat History", height=500)
|
| 27 |
|
| 28 |
with gr.Row():
|
| 29 |
-
#
|
| 30 |
-
with gr.
|
| 31 |
-
user_input = gr.Textbox(
|
| 32 |
-
|
| 33 |
-
|
| 34 |
send_button = gr.Button("📤", elem_id="send_button")
|
| 35 |
|
| 36 |
-
# Add CSS
|
| 37 |
demo.css = """
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
#send_button {
|
| 39 |
width: 40px;
|
| 40 |
height: 40px;
|
| 41 |
-
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
display: flex;
|
| 44 |
justify-content: center;
|
| 45 |
align-items: center;
|
| 46 |
-
|
|
|
|
|
|
|
|
|
|
| 47 |
}
|
| 48 |
"""
|
| 49 |
|
|
|
|
| 26 |
chatbot_component = gr.Chatbot(type="messages", label="Chat History", height=500)
|
| 27 |
|
| 28 |
with gr.Row():
|
| 29 |
+
# Container for input and send button
|
| 30 |
+
with gr.Box(elem_id="input_container"):
|
| 31 |
+
user_input = gr.Textbox(
|
| 32 |
+
placeholder="Type your message here...", label=None, lines=1, elem_id="user_input"
|
| 33 |
+
)
|
| 34 |
send_button = gr.Button("📤", elem_id="send_button")
|
| 35 |
|
| 36 |
+
# Add CSS for styling the input container and placing the button inside
|
| 37 |
demo.css = """
|
| 38 |
+
#input_container {
|
| 39 |
+
display: flex;
|
| 40 |
+
align-items: center;
|
| 41 |
+
border: 1px solid #ccc;
|
| 42 |
+
border-radius: 8px;
|
| 43 |
+
padding: 5px;
|
| 44 |
+
}
|
| 45 |
+
#user_input {
|
| 46 |
+
flex-grow: 1;
|
| 47 |
+
border: none;
|
| 48 |
+
outline: none;
|
| 49 |
+
padding: 8px;
|
| 50 |
+
}
|
| 51 |
#send_button {
|
| 52 |
width: 40px;
|
| 53 |
height: 40px;
|
| 54 |
+
background-color: #007bff;
|
| 55 |
+
color: white;
|
| 56 |
+
border: none;
|
| 57 |
+
border-radius: 50%;
|
| 58 |
display: flex;
|
| 59 |
justify-content: center;
|
| 60 |
align-items: center;
|
| 61 |
+
cursor: pointer;
|
| 62 |
+
}
|
| 63 |
+
#send_button:hover {
|
| 64 |
+
background-color: #0056b3;
|
| 65 |
}
|
| 66 |
"""
|
| 67 |
|