Behnamm commited on
Commit
d176011
1 Parent(s): c2c3f47

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -88,8 +88,18 @@ def init_leaderboard(dataframe):
88
  interactive=False,
89
  )
90
 
91
-
92
- demo = gr.Blocks(css=custom_css)
 
 
 
 
 
 
 
 
 
 
93
  with demo:
94
  gr.HTML(TITLE)
95
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")
 
88
  interactive=False,
89
  )
90
 
91
+ js_func = """
92
+ function refresh() {
93
+ const url = new URL(window.location);
94
+
95
+ if (url.searchParams.get('__theme') !== 'dark') {
96
+ url.searchParams.set('__theme', 'dark');
97
+ window.location.href = url.href;
98
+ }
99
+ }
100
+ """
101
+
102
+ demo = gr.Blocks(css=custom_css, js = js_func)
103
  with demo:
104
  gr.HTML(TITLE)
105
  gr.Markdown(INTRODUCTION_TEXT, elem_classes="markdown-text")