rahul7star commited on
Commit
5600a68
·
verified ·
1 Parent(s): a6ba9d3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +90 -37
app.py CHANGED
@@ -213,10 +213,7 @@ def build_ui():
213
  with gr.Blocks(
214
  theme=gr.themes.Soft(primary_hue="indigo"),
215
  css="""
216
- /* --- Hide share/delete icons --- */
217
- #ohamlab .wrap.svelte-1lcyrj3 > div > div > button {
218
- display: none !important;
219
- }
220
  [data-testid="share-btn"],
221
  [data-testid="delete-btn"],
222
  .message-controls,
@@ -225,7 +222,7 @@ def build_ui():
225
  visibility: hidden !important;
226
  }
227
 
228
- /* --- User (Right) Message Bubble --- */
229
  #ohamlab .message.user {
230
  background-color: #4f46e5 !important;
231
  color: white !important;
@@ -233,9 +230,11 @@ def build_ui():
233
  align-self: flex-end !important;
234
  text-align: right !important;
235
  margin-left: 25%;
 
 
236
  }
237
 
238
- /* --- OhamLab (Left) Message Bubble --- */
239
  #ohamlab .message.assistant {
240
  background-color: #f8f9fa !important;
241
  color: #111 !important;
@@ -243,45 +242,99 @@ def build_ui():
243
  align-self: flex-start !important;
244
  text-align: left !important;
245
  margin-right: 25%;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
246
  }
247
- #ohamlab .chatbot .wrap.svelte-1lcyrj3 > div > div > button {
248
- display: none !important; /* hide share/delete icons */
249
- }
250
 
251
- /* --- Overall Container --- */
252
  .gradio-container {
253
  max-width: 900px !important;
254
  margin: auto;
255
  padding-top: .5rem;
256
  }
257
- textarea {
258
- resize: none !important;
259
- border-radius: 12px !important;
260
- border: 1px solid #d1d5db !important;
261
- box-shadow: 0 1px 3px rgba(0,0,0,0.08);
262
- }
263
- button.primary {
264
- background-color: #4f46e5 !important;
265
- color: white !important;
266
- border-radius: 10px !important;
267
- padding: 0.6rem 1.4rem !important;
268
- font-weight: 600;
269
- transition: all 0.2s ease-in-out;
270
- }
271
- button.primary:hover {
272
- background-color: #4338ca !important;
273
- }
274
- button.secondary {
275
- background-color: #f3f4f6 !important;
276
- border-radius: 10px !important;
277
- color: #374151 !important;
278
- font-weight: 500;
279
- transition: all 0.2s ease-in-out;
280
- }
281
- button.secondary:hover {
282
- background-color: #e5e7eb !important;
283
- }
284
  """,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
285
  ) as demo:
286
 
287
  # Chatbot area
 
213
  with gr.Blocks(
214
  theme=gr.themes.Soft(primary_hue="indigo"),
215
  css="""
216
+ /* --- Hide Share & Delete Buttons --- */
 
 
 
217
  [data-testid="share-btn"],
218
  [data-testid="delete-btn"],
219
  .message-controls,
 
222
  visibility: hidden !important;
223
  }
224
 
225
+ /* --- User (Right Side) --- */
226
  #ohamlab .message.user {
227
  background-color: #4f46e5 !important;
228
  color: white !important;
 
230
  align-self: flex-end !important;
231
  text-align: right !important;
232
  margin-left: 25%;
233
+ padding: 0.6rem 1rem !important;
234
+ max-width: 70%;
235
  }
236
 
237
+ /* --- Bot (Left Side) --- */
238
  #ohamlab .message.assistant {
239
  background-color: #f8f9fa !important;
240
  color: #111 !important;
 
242
  align-self: flex-start !important;
243
  text-align: left !important;
244
  margin-right: 25%;
245
+ padding: 0.6rem 1rem !important;
246
+ max-width: 70%;
247
+ }
248
+
249
+ /* --- Replace bot icon with 'OhamLab' label --- */
250
+ #ohamlab .avatar span,
251
+ #ohamlab .avatar {
252
+ background: none !important;
253
+ color: #4f46e5 !important;
254
+ font-weight: 700 !important;
255
+ font-size: 0.9rem !important;
256
+ }
257
+ #ohamlab .avatar::before {
258
+ content: "OhamLab" !important;
259
+ display: inline-block;
260
  }
 
 
 
261
 
 
262
  .gradio-container {
263
  max-width: 900px !important;
264
  margin: auto;
265
  padding-top: .5rem;
266
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
267
  """,
268
+ # css="""
269
+ # /* --- Hide share/delete icons --- */
270
+ # #ohamlab .wrap.svelte-1lcyrj3 > div > div > button {
271
+ # display: none !important;
272
+ # }
273
+ # [data-testid="share-btn"],
274
+ # [data-testid="delete-btn"],
275
+ # .message-controls,
276
+ # .message-actions {
277
+ # display: none !important;
278
+ # visibility: hidden !important;
279
+ # }
280
+
281
+ # /* --- User (Right) Message Bubble --- */
282
+ # #ohamlab .message.user {
283
+ # background-color: #4f46e5 !important;
284
+ # color: white !important;
285
+ # border-radius: 14px !important;
286
+ # align-self: flex-end !important;
287
+ # text-align: right !important;
288
+ # margin-left: 25%;
289
+ # }
290
+
291
+ # /* --- OhamLab (Left) Message Bubble --- */
292
+ # #ohamlab .message.assistant {
293
+ # background-color: #f8f9fa !important;
294
+ # color: #111 !important;
295
+ # border-radius: 14px !important;
296
+ # align-self: flex-start !important;
297
+ # text-align: left !important;
298
+ # margin-right: 25%;
299
+ # }
300
+ # #ohamlab .chatbot .wrap.svelte-1lcyrj3 > div > div > button {
301
+ # display: none !important; /* hide share/delete icons */
302
+ # }
303
+
304
+ # /* --- Overall Container --- */
305
+ # .gradio-container {
306
+ # max-width: 900px !important;
307
+ # margin: auto;
308
+ # padding-top: .5rem;
309
+ # }
310
+ # textarea {
311
+ # resize: none !important;
312
+ # border-radius: 12px !important;
313
+ # border: 1px solid #d1d5db !important;
314
+ # box-shadow: 0 1px 3px rgba(0,0,0,0.08);
315
+ # }
316
+ # button.primary {
317
+ # background-color: #4f46e5 !important;
318
+ # color: white !important;
319
+ # border-radius: 10px !important;
320
+ # padding: 0.6rem 1.4rem !important;
321
+ # font-weight: 600;
322
+ # transition: all 0.2s ease-in-out;
323
+ # }
324
+ # button.primary:hover {
325
+ # background-color: #4338ca !important;
326
+ # }
327
+ # button.secondary {
328
+ # background-color: #f3f4f6 !important;
329
+ # border-radius: 10px !important;
330
+ # color: #374151 !important;
331
+ # font-weight: 500;
332
+ # transition: all 0.2s ease-in-out;
333
+ # }
334
+ # button.secondary:hover {
335
+ # background-color: #e5e7eb !important;
336
+ # }
337
+ # """,
338
  ) as demo:
339
 
340
  # Chatbot area