Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -587,6 +587,27 @@ html, body, .gradio-container {
|
|
| 587 |
border-radius: 18px !important;
|
| 588 |
}
|
| 589 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 590 |
textarea, input, .wrap textarea {
|
| 591 |
border-radius: 18px !important;
|
| 592 |
border: 1px solid #d5ddd9 !important;
|
|
@@ -650,6 +671,9 @@ def build_header_html() -> str:
|
|
| 650 |
|
| 651 |
def respond(message, history, learning_mode, quiz_questions, show_sources):
|
| 652 |
history = history or []
|
|
|
|
|
|
|
|
|
|
| 653 |
|
| 654 |
answer_text, sources = get_answer_and_sources(
|
| 655 |
message=message,
|
|
@@ -715,8 +739,7 @@ with gr.Blocks(title=APP_TITLE) as demo:
|
|
| 715 |
chatbot = gr.Chatbot(
|
| 716 |
height=500,
|
| 717 |
elem_id="chatbot",
|
| 718 |
-
show_label=False
|
| 719 |
-
type="messages"
|
| 720 |
)
|
| 721 |
|
| 722 |
msg = gr.Textbox(
|
|
|
|
| 587 |
border-radius: 18px !important;
|
| 588 |
}
|
| 589 |
|
| 590 |
+
/* user bubble */
|
| 591 |
+
#chatbot [data-testid="chatbot-message-user"],
|
| 592 |
+
#chatbot .message.user,
|
| 593 |
+
#chatbot .user {
|
| 594 |
+
background: #d9fdd3 !important;
|
| 595 |
+
color: #1f2c34 !important;
|
| 596 |
+
border-radius: 16px !important;
|
| 597 |
+
border: 1px solid #c7edc1 !important;
|
| 598 |
+
}
|
| 599 |
+
|
| 600 |
+
/* assistant bubble */
|
| 601 |
+
#chatbot [data-testid="chatbot-message-assistant"],
|
| 602 |
+
#chatbot .message.bot,
|
| 603 |
+
#chatbot .bot,
|
| 604 |
+
#chatbot .assistant {
|
| 605 |
+
background: #ffffff !important;
|
| 606 |
+
color: #1f2c34 !important;
|
| 607 |
+
border-radius: 16px !important;
|
| 608 |
+
border: 1px solid #e4e7e7 !important;
|
| 609 |
+
}
|
| 610 |
+
|
| 611 |
textarea, input, .wrap textarea {
|
| 612 |
border-radius: 18px !important;
|
| 613 |
border: 1px solid #d5ddd9 !important;
|
|
|
|
| 671 |
|
| 672 |
def respond(message, history, learning_mode, quiz_questions, show_sources):
|
| 673 |
history = history or []
|
| 674 |
+
message = (message or "").strip()
|
| 675 |
+
if not message:
|
| 676 |
+
return history, ""
|
| 677 |
|
| 678 |
answer_text, sources = get_answer_and_sources(
|
| 679 |
message=message,
|
|
|
|
| 739 |
chatbot = gr.Chatbot(
|
| 740 |
height=500,
|
| 741 |
elem_id="chatbot",
|
| 742 |
+
show_label=False
|
|
|
|
| 743 |
)
|
| 744 |
|
| 745 |
msg = gr.Textbox(
|