fionasu commited on
Commit
443aa67
Β·
verified Β·
1 Parent(s): fa0de28

added theme again

Browse files
Files changed (1) hide show
  1. app.py +39 -38
app.py CHANGED
@@ -1,6 +1,44 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  #STEP 1 FROM SEMATIC SEARCH
5
  from sentence_transformers import SentenceTransformer
6
  import torch
@@ -190,7 +228,7 @@ def reset_inputs():
190
  [] # activity
191
  )
192
 
193
- with gr.Blocks() as demo:
194
  with gr.Row():
195
  # ─── left column: your controls ───
196
  with gr.Column(scale=1):
@@ -316,42 +354,5 @@ with gr.Blocks() as demo:
316
  outputs=[chat_box, msg]
317
  )
318
 
319
- theme = gr.themes.Monochrome(
320
- primary_hue=gr.themes.Color(c100="#f5f5f3", c200="#fbfaf8", c300="#f9f9f9", c400="#eee9ee", c50="rgba(255, 255, 255, 1)", c500="rgba(0, 0, 0, 1)", c600="rgba(26.934374999999992, 26.934374999999992, 26.934374999999992, 1)", c700="rgba(10.943750000000012, 10.943750000000012, 10.943750000000012, 1)", c800="rgba(17.053125000000005, 17.053125000000005, 17.053125000000005, 1)", c900="#fffefe", c950="#fffefe"),
321
- secondary_hue=gr.themes.Color(c100="#f29c74", c200="#f4b7a8", c300="#fffefe", c400="#fffefe", c50="#e46e45", c500="#fffefe", c600="#fffefe", c700="#fffefe", c800="#fffefe", c900="#fffefe", c950="#fffefe"),
322
- neutral_hue=gr.themes.Color(c100="#6b8ea8", c200="#a4c5e8", c300="rgba(0, 0, 0, 1)", c400="rgba(0, 0, 0, 1)", c50="#284566", c500="rgba(0, 0, 0, 1)", c600="rgba(0, 0, 0, 1)", c700="rgba(0, 0, 0, 1)", c800="rgba(0, 0, 0, 1)", c900="rgba(0, 0, 0, 1)", c950="rgba(0, 0, 0, 1)"),
323
- font=[gr.themes.GoogleFont('open sans'), 'ui-sans-serif', 'system-ui', 'sans-serif'],
324
- ).set(
325
- body_background_fill='*primary_50',
326
- body_background_fill_dark='*primary_700',
327
- body_text_color='*primary_500',
328
- body_text_color_dark='*primary_400',
329
- body_text_color_subdued='*neutral_50',
330
- body_text_color_subdued_dark='*primary_300',
331
- background_fill_primary='*primary_400',
332
- background_fill_primary_dark='*neutral_100',
333
- background_fill_secondary='*primary_400',
334
- background_fill_secondary_dark='*neutral_50',
335
- border_color_accent_dark='*secondary_50',
336
- border_color_accent_subdued_dark='*primary_50',
337
- border_color_primary='*neutral_50',
338
- border_color_primary_dark='*neutral_100',
339
- color_accent='*primary_50',
340
- color_accent_soft_dark='*neutral_100',
341
- block_background_fill_dark='*neutral_50',
342
- checkbox_background_color='*primary_400',
343
- checkbox_background_color_selected='*primary_700',
344
- checkbox_background_color_selected_dark='*neutral_50',
345
- checkbox_label_border_color_dark='*neutral_50',
346
- input_background_fill='*primary_50',
347
- input_background_fill_dark='*neutral_100',
348
- input_border_color='*neutral_50',
349
- input_border_color_dark='*neutral_50',
350
- input_border_width='2px',
351
- table_odd_background_fill='*neutral_100',
352
- button_primary_background_fill='*neutral_50',
353
- button_primary_background_fill_dark='*neutral_100',
354
- button_primary_background_fill_hover='*neutral_100'
355
- )
356
 
357
  demo.launch(debug=True)
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
+ theme = gr.themes.Monochrome(
5
+ primary_hue=gr.themes.Color(c100="#f5f5f3", c200="#fbfaf8", c300="#f9f9f9", c400="#eee9ee", c50="rgba(255, 255, 255, 1)", c500="rgba(0, 0, 0, 1)", c600="rgba(26.934374999999992, 26.934374999999992, 26.934374999999992, 1)", c700="rgba(10.943750000000012, 10.943750000000012, 10.943750000000012, 1)", c800="rgba(17.053125000000005, 17.053125000000005, 17.053125000000005, 1)", c900="#fffefe", c950="#fffefe"),
6
+ secondary_hue=gr.themes.Color(c100="#f29c74", c200="#f4b7a8", c300="#fffefe", c400="#fffefe", c50="#e46e45", c500="#fffefe", c600="#fffefe", c700="#fffefe", c800="#fffefe", c900="#fffefe", c950="#fffefe"),
7
+ neutral_hue=gr.themes.Color(c100="#6b8ea8", c200="#a4c5e8", c300="rgba(0, 0, 0, 1)", c400="rgba(0, 0, 0, 1)", c50="#284566", c500="rgba(0, 0, 0, 1)", c600="rgba(0, 0, 0, 1)", c700="rgba(0, 0, 0, 1)", c800="rgba(0, 0, 0, 1)", c900="rgba(0, 0, 0, 1)", c950="rgba(0, 0, 0, 1)"),
8
+ font=[gr.themes.GoogleFont('open sans'), 'ui-sans-serif', 'system-ui', 'sans-serif'],
9
+ ).set(
10
+ body_background_fill='*primary_50',
11
+ body_background_fill_dark='*primary_700',
12
+ body_text_color='*primary_500',
13
+ body_text_color_dark='*primary_400',
14
+ body_text_color_subdued='*neutral_50',
15
+ body_text_color_subdued_dark='*primary_300',
16
+ background_fill_primary='*primary_400',
17
+ background_fill_primary_dark='*neutral_100',
18
+ background_fill_secondary='*primary_400',
19
+ background_fill_secondary_dark='*neutral_50',
20
+ border_color_accent_dark='*secondary_50',
21
+ border_color_accent_subdued_dark='*primary_50',
22
+ border_color_primary='*neutral_50',
23
+ border_color_primary_dark='*neutral_100',
24
+ color_accent='*primary_50',
25
+ color_accent_soft_dark='*neutral_100',
26
+ block_background_fill_dark='*neutral_50',
27
+ checkbox_background_color='*primary_400',
28
+ checkbox_background_color_selected='*primary_700',
29
+ checkbox_background_color_selected_dark='*neutral_50',
30
+ checkbox_label_border_color_dark='*neutral_50',
31
+ input_background_fill='*primary_50',
32
+ input_background_fill_dark='*neutral_100',
33
+ input_border_color='*neutral_50',
34
+ input_border_color_dark='*neutral_50',
35
+ input_border_width='2px',
36
+ table_odd_background_fill='*neutral_100',
37
+ button_primary_background_fill='*neutral_50',
38
+ button_primary_background_fill_dark='*neutral_100',
39
+ button_primary_background_fill_hover='*neutral_100'
40
+ )
41
+
42
  #STEP 1 FROM SEMATIC SEARCH
43
  from sentence_transformers import SentenceTransformer
44
  import torch
 
228
  [] # activity
229
  )
230
 
231
+ with gr.Blocks(theme=theme) as demo:
232
  with gr.Row():
233
  # ─── left column: your controls ───
234
  with gr.Column(scale=1):
 
354
  outputs=[chat_box, msg]
355
  )
356
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
357
 
358
  demo.launch(debug=True)