Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -488,6 +488,42 @@ def rag_memory_stream(message, history):
|
|
488 |
# After generating the complete response, add it to history
|
489 |
user_session.add_to_history("assistant", full_response)
|
490 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
491 |
# Gradio Interface Setup with improved UX
|
492 |
def chatbot_interface():
|
493 |
# Get API key (in a real application, handle this more securely)
|
@@ -530,7 +566,7 @@ def chatbot_interface():
|
|
530 |
with registration_container:
|
531 |
gr.Markdown(
|
532 |
"""
|
533 |
-
<div style='font-size:
|
534 |
Your privacy is our concern, please provide your nickname.
|
535 |
</div>
|
536 |
"""
|
@@ -556,6 +592,8 @@ def chatbot_interface():
|
|
556 |
fn=rag_memory_stream,
|
557 |
title="Chat with GBVR",
|
558 |
fill_height=True,
|
|
|
|
|
559 |
)
|
560 |
|
561 |
# Footer with version info
|
@@ -573,4 +611,4 @@ def chatbot_interface():
|
|
573 |
# Launch the interface
|
574 |
if __name__ == "__main__":
|
575 |
# Launch the interface
|
576 |
-
chatbot_interface().launch(share=True, inbrowser=True)
|
|
|
488 |
# After generating the complete response, add it to history
|
489 |
user_session.add_to_history("assistant", full_response)
|
490 |
|
491 |
+
custom_css = """
|
492 |
+
body {
|
493 |
+
font-family: "Arial", serif;
|
494 |
+
}
|
495 |
+
.gradio-container {
|
496 |
+
font-family: "Times New Roman", serif;
|
497 |
+
}
|
498 |
+
.gr-button {
|
499 |
+
background-color: #007bff; /* Blue button */
|
500 |
+
color: white;
|
501 |
+
border: none;
|
502 |
+
border-radius: 5px;
|
503 |
+
font-size: 16px;
|
504 |
+
padding: 10px 20px;
|
505 |
+
cursor: pointer;
|
506 |
+
}
|
507 |
+
.gr-textbox:focus, .gr-button:focus {
|
508 |
+
outline: none; /* Remove outline focus for a cleaner look */
|
509 |
+
}
|
510 |
+
/* Custom CSS for the examples section */
|
511 |
+
.gr-examples {
|
512 |
+
font-size: 30px; /* Increase font size of examples */
|
513 |
+
background-color: #f9f9f9; /* Light background color */
|
514 |
+
border-radius: 30px; /* Rounded corners */
|
515 |
+
}
|
516 |
+
.gr-examples .example {
|
517 |
+
background-color: white; /* White background for each example */
|
518 |
+
cursor: pointer; /* Change cursor to pointer on hover */
|
519 |
+
transition: background-color 0.3s ease; /* Smooth hover effect */
|
520 |
+
}
|
521 |
+
.gr-examples .example:hover {
|
522 |
+
background-color: #f1f1f1; /* Light gray background on hover */
|
523 |
+
}
|
524 |
+
"""
|
525 |
+
|
526 |
+
|
527 |
# Gradio Interface Setup with improved UX
|
528 |
def chatbot_interface():
|
529 |
# Get API key (in a real application, handle this more securely)
|
|
|
566 |
with registration_container:
|
567 |
gr.Markdown(
|
568 |
"""
|
569 |
+
<div style='font-size: 32px;'>
|
570 |
Your privacy is our concern, please provide your nickname.
|
571 |
</div>
|
572 |
"""
|
|
|
592 |
fn=rag_memory_stream,
|
593 |
title="Chat with GBVR",
|
594 |
fill_height=True,
|
595 |
+
css=custom_css,
|
596 |
+
theme="soft",
|
597 |
)
|
598 |
|
599 |
# Footer with version info
|
|
|
611 |
# Launch the interface
|
612 |
if __name__ == "__main__":
|
613 |
# Launch the interface
|
614 |
+
chatbot_interface().launch(share=True, inbrowser=True, debug=True)
|