aditibera commited on
Commit
c1a3cd4
·
verified ·
1 Parent(s): fe162a1

updated theme

Browse files
Files changed (1) hide show
  1. app.py +30 -2
app.py CHANGED
@@ -1,5 +1,8 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
 
 
 
3
 
4
  # STEP 1 FROM SEMANTIC SEARCH
5
  from sentence_transformers import SentenceTransformer
@@ -107,8 +110,33 @@ def submit_survey(name, country):
107
  print(f"Survey received - Name: {name}, Country: {country}")
108
  return f"Thank you, {name}! Your survey response has been recorded.", name, country
109
 
110
-
111
- with gr.Blocks() as demo:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
112
  name_state = gr.State()
113
  country_state = gr.State()
114
  chat_state = gr.State([])
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
+ from gradio.themes.utils import colors, fonts, sizes
4
+ from sentence_transformers import SentenceTransformer
5
+ import torch
6
 
7
  # STEP 1 FROM SEMANTIC SEARCH
8
  from sentence_transformers import SentenceTransformer
 
110
  print(f"Survey received - Name: {name}, Country: {country}")
111
  return f"Thank you, {name}! Your survey response has been recorded.", name, country
112
 
113
+ class MyCustomTheme(gr.themes.Base):
114
+ def __init__(self):
115
+ super().__init__(
116
+ primary_hue=colors.green, # You can still use named hues for accents
117
+ neutral_hue=colors.Color(
118
+ name="custom_offwhite",
119
+ c50="#fcf1db", # lightest
120
+ c100="#fcf1db", # you can repeat or darken progressively
121
+ c200="#f5e5c6",
122
+ c300="#e8d6af",
123
+ c400="#d9c298",
124
+ c500="#caae83", # base
125
+ c600="#b89c70",
126
+ c700="#a28a5f",
127
+ c800="#8e794f",
128
+ c900="#7b6841",
129
+ c950="#695936"
130
+ ),
131
+ font=fonts.GoogleFont("Poppins"),
132
+ spacing=sizes.spacing_md,
133
+ radius=sizes.radius_md
134
+ )
135
+
136
+ custom_theme = MyCustomTheme()
137
+
138
+
139
+ with gr.Blocks(theme=custom_theme) as demo:
140
  name_state = gr.State()
141
  country_state = gr.State()
142
  chat_state = gr.State([])