ggcristian commited on
Commit
9eca770
·
1 Parent(s): 9efe36c

Support for Dark mode. Avoids refreshing to enforce light mode!

Browse files
Files changed (4) hide show
  1. app.py +3 -13
  2. logo_new.png +3 -0
  3. style/css_html_js.py +9 -0
  4. utils.py +1 -1
app.py CHANGED
@@ -158,18 +158,8 @@ def generate_scatter_plot(benchmark, metric):
158
  return fig
159
 
160
 
161
- js_func = """
162
- function refresh() {
163
- const url = new URL(window.location);
164
- if (url.searchParams.get('__theme') !== 'light') {
165
- url.searchParams.set('__theme', 'light');
166
- window.location.href = url.href;
167
- }
168
- }
169
- """
170
-
171
  with gr.Blocks(
172
- css=custom_css, js=js_func, theme=gr.themes.Default(primary_hue=colors.emerald)
173
  ) as app:
174
  df_icarus, benchmarks, metrics, default_metric = read_data(
175
  "results/results_icarus.json"
@@ -197,7 +187,7 @@ with gr.Blocks(
197
  gr.HTML(
198
  """
199
  <div align="center">
200
- <img src='/gradio_api/file=logo.png' alt='TuRTLe Logo' width='220'/>
201
  </div>
202
  """
203
  )
@@ -535,7 +525,7 @@ with gr.Blocks(
535
 
536
  app.launch(
537
  allowed_paths=[
538
- "logo.png",
539
  "hpai_logo_grad.png",
540
  "bsc-logo.png",
541
  ]
 
158
  return fig
159
 
160
 
 
 
 
 
 
 
 
 
 
 
161
  with gr.Blocks(
162
+ css=custom_css, theme=gr.themes.Default(primary_hue=colors.emerald)
163
  ) as app:
164
  df_icarus, benchmarks, metrics, default_metric = read_data(
165
  "results/results_icarus.json"
 
187
  gr.HTML(
188
  """
189
  <div align="center">
190
+ <img src='/gradio_api/file=logo_new.png' alt='TuRTLe Logo' width='220'/>
191
  </div>
192
  """
193
  )
 
525
 
526
  app.launch(
527
  allowed_paths=[
528
+ "logo_new.png",
529
  "hpai_logo_grad.png",
530
  "bsc-logo.png",
531
  ]
logo_new.png ADDED

Git LFS Details

  • SHA256: ca5222d13bb7df92a54f0f2b27b23b2782c8e4e60865fc6c41daecb3a5ae3091
  • Pointer size: 130 Bytes
  • Size of remote file: 79.3 kB
style/css_html_js.py CHANGED
@@ -162,6 +162,15 @@ input[role="listbox"] {
162
  .gradio-container .contain {
163
  flex-grow: 0;
164
  }
 
 
 
 
 
 
 
 
 
165
  """
166
 
167
  get_window_url_params = """
 
162
  .gradio-container .contain {
163
  flex-grow: 0;
164
  }
165
+
166
+ .dataframe-leaderboard a {
167
+ color: white !important;
168
+ }
169
+
170
+ .dataframe-leaderboard a:hover {
171
+ color: #ddd !important;
172
+ text-decoration: underline;
173
+ }
174
  """
175
 
176
  get_window_url_params = """
utils.py CHANGED
@@ -19,7 +19,7 @@ def model_hyperlink(link, model_name, release):
19
  if release == "V1":
20
  return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
21
  else:
22
- return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a> <span style="font-variant: all-small-caps; font-weight: 600">new</span>'
23
 
24
 
25
  def handle_special_cases(benchmark, metric):
 
19
  if release == "V1":
20
  return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a>'
21
  else:
22
+ return f'<a target="_blank" href="{link}" style="color: var(--link-text-color); text-decoration: underline;text-decoration-style: dotted;">{model_name}</a> <span style="color: white; opacity: 0.7; font-variant: all-small-caps; font-weight: 600">new</span>'
23
 
24
 
25
  def handle_special_cases(benchmark, metric):