Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -70,34 +70,43 @@ custom_theme = gr.themes.Soft(
|
|
70 |
).set(
|
71 |
# Set the background to a deep black
|
72 |
body_background_fill="#030712",
|
73 |
-
# Customize the chatbot's appearance
|
74 |
-
chatbot_background_color="#1F2937", # Darker gray for chat history
|
75 |
-
chatbot_border_color="transparent",
|
76 |
-
chatbot_border_width="0",
|
77 |
-
chatbot_border_radius="8px",
|
78 |
-
|
79 |
# Style the text box and submit button to match the theme
|
80 |
block_background_fill="#1F2937",
|
81 |
block_border_color="#34D399", # Glowing green border
|
82 |
block_border_width="2px",
|
83 |
block_border_radius="25px",
|
84 |
-
|
85 |
button_background_fill="#34D399",
|
86 |
button_background_fill_hover="#10B981",
|
87 |
button_text_color="#1F2937",
|
88 |
button_border_radius="25px",
|
89 |
|
90 |
-
# Style the chat messages
|
91 |
-
chat_message_background_color="#111827", # Darker bubble for the assistant
|
92 |
-
chat_message_background_color_user="#374151", # Slightly lighter bubble for the user
|
93 |
-
chat_message_border_radius="10px",
|
94 |
-
|
95 |
# Set text colors
|
96 |
text_color="#34D399",
|
97 |
background_fill_primary="#030712", # Main background color
|
98 |
background_fill_secondary="#1F2937",
|
99 |
)
|
100 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
101 |
# Use the custom theme with the ChatInterface
|
102 |
demo = gr.ChatInterface(
|
103 |
generate_response,
|
@@ -111,7 +120,8 @@ demo = gr.ChatInterface(
|
|
111 |
retry_btn=None,
|
112 |
undo_btn=None,
|
113 |
clear_btn="Clear Chat",
|
|
|
114 |
)
|
115 |
|
116 |
# Launch the app
|
117 |
-
demo.launch()
|
|
|
70 |
).set(
|
71 |
# Set the background to a deep black
|
72 |
body_background_fill="#030712",
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
# Style the text box and submit button to match the theme
|
74 |
block_background_fill="#1F2937",
|
75 |
block_border_color="#34D399", # Glowing green border
|
76 |
block_border_width="2px",
|
77 |
block_border_radius="25px",
|
|
|
78 |
button_background_fill="#34D399",
|
79 |
button_background_fill_hover="#10B981",
|
80 |
button_text_color="#1F2937",
|
81 |
button_border_radius="25px",
|
82 |
|
|
|
|
|
|
|
|
|
|
|
83 |
# Set text colors
|
84 |
text_color="#34D399",
|
85 |
background_fill_primary="#030712", # Main background color
|
86 |
background_fill_secondary="#1F2937",
|
87 |
)
|
88 |
|
89 |
+
# Custom CSS to style the chatbot messages and container, fixing the TypeError.
|
90 |
+
custom_css = """
|
91 |
+
.gradio-container {
|
92 |
+
background-color: #030712;
|
93 |
+
color: #34D399;
|
94 |
+
}
|
95 |
+
.gradio-chatbot {
|
96 |
+
background-color: #1F2937;
|
97 |
+
border: none;
|
98 |
+
border-radius: 8px;
|
99 |
+
}
|
100 |
+
.gradio-chatbot .message.bot {
|
101 |
+
background-color: #111827;
|
102 |
+
border-radius: 10px;
|
103 |
+
}
|
104 |
+
.gradio-chatbot .message.user {
|
105 |
+
background-color: #374151;
|
106 |
+
border-radius: 10px;
|
107 |
+
}
|
108 |
+
"""
|
109 |
+
|
110 |
# Use the custom theme with the ChatInterface
|
111 |
demo = gr.ChatInterface(
|
112 |
generate_response,
|
|
|
120 |
retry_btn=None,
|
121 |
undo_btn=None,
|
122 |
clear_btn="Clear Chat",
|
123 |
+
css=custom_css,
|
124 |
)
|
125 |
|
126 |
# Launch the app
|
127 |
+
demo.launch()
|