Wanswan commited on
Commit
048a266
·
verified ·
1 Parent(s): ed959fa

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -5
app.py CHANGED
@@ -151,9 +151,43 @@ async def respond(user_input, history, step, language, questions, followup_mode,
151
 
152
  def init():
153
  return [{"role": "assistant", "content": WELCOME_MESSAGE_EN}], 0, "", [], False, [], 0
154
-
155
- with gr.Blocks(css=""".send-btn {background-color: #25D366 !important; color: white !important; border-radius: 24px; padding: 8px 20px; height: 48px; width: 60px; margin-left: 8px;}""") as demo:
156
- gr.HTML("""<script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  const waitForChatbox = () => {
158
  const chatbox = document.getElementById("chatbox");
159
  if (chatbox) {
@@ -166,9 +200,19 @@ with gr.Blocks(css=""".send-btn {background-color: #25D366 !important; color: wh
166
  }
167
  };
168
  waitForChatbox();
169
- </script>""")
 
 
 
 
 
 
 
 
 
 
 
170
 
171
- chatbot = gr.Chatbot(elem_id="chatbox", avatar_images=["user_avatar.jpg", "bot_avatar.png"], bubble_full_width=False, height=500, type="messages")
172
 
173
  with gr.Row():
174
  user_input = gr.Textbox(show_label=False, placeholder="Type your message here and press send...", container=True, scale=10)
 
151
 
152
  def init():
153
  return [{"role": "assistant", "content": WELCOME_MESSAGE_EN}], 0, "", [], False, [], 0
154
+
155
+ with gr.Blocks(css="""
156
+ #chatbox .message.user {
157
+ background-color: #DCF8C6 !important;
158
+ }
159
+ #chatbox .message.assistant {
160
+ background-color: #ffffff !important;
161
+ }
162
+ #chatbox .avatar-container {
163
+ width: 64px !important;
164
+ height: 64px !important;
165
+ min-width: 64px !important;
166
+ min-height: 64px !important;
167
+ background-size: 100% 100% !important;
168
+ background-position: center center !important;
169
+ border-radius: 50% !important;
170
+ padding: 0 !important;
171
+ margin: 0 !important;
172
+ border: none !important;
173
+ box-shadow: none !important;
174
+ background-color: transparent !important;
175
+ }
176
+ .send-btn {
177
+ background-color: #25D366 !important;
178
+ color: white;
179
+ border: none;
180
+ border-radius: 24px;
181
+ font-size: 20px;
182
+ padding: 8px 20px;
183
+ height: 48px;
184
+ width: 60px;
185
+ margin-left: 8px;
186
+ }
187
+ """) as demo:
188
+
189
+ gr.HTML("""
190
+ <script>
191
  const waitForChatbox = () => {
192
  const chatbox = document.getElementById("chatbox");
193
  if (chatbox) {
 
200
  }
201
  };
202
  waitForChatbox();
203
+ </script>
204
+ """)
205
+
206
+ chatbot = gr.Chatbot(
207
+ elem_id="chatbox",
208
+ label="",
209
+ avatar_images=["user_avatar.jpg", "bot_avatar.png"],
210
+ bubble_full_width=False,
211
+ height=500,
212
+ show_copy_button=False,
213
+ type="messages"
214
+ )
215
 
 
216
 
217
  with gr.Row():
218
  user_input = gr.Textbox(show_label=False, placeholder="Type your message here and press send...", container=True, scale=10)