Spaces:
Sleeping
Sleeping
Petr Tsvetkov
commited on
Commit
·
6f224a6
1
Parent(s):
2065aab
Force the light theme; add requirements.txt
Browse files- app.py +13 -1
- requirements.txt +0 -0
app.py
CHANGED
@@ -99,7 +99,19 @@ def next_sample(current_sample_ind, shuffled_idx):
|
|
99 |
with open("head.html") as head_file:
|
100 |
head_html = head_file.read()
|
101 |
|
102 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
repo_val = gr.Textbox(interactive=False, label='repo', visible=False)
|
104 |
hash_val = gr.Textbox(interactive=False, label='hash', visible=False)
|
105 |
shuffled_idx_val = gr.JSON(visible=False)
|
|
|
99 |
with open("head.html") as head_file:
|
100 |
head_html = head_file.read()
|
101 |
|
102 |
+
force_light_theme_js_func = """
|
103 |
+
function refresh() {
|
104 |
+
const url = new URL(window.location);
|
105 |
+
|
106 |
+
if (url.searchParams.get('__theme') !== 'light') {
|
107 |
+
url.searchParams.set('__theme', 'light');
|
108 |
+
window.location.href = url.href;
|
109 |
+
}
|
110 |
+
}
|
111 |
+
"""
|
112 |
+
|
113 |
+
with gr.Blocks(theme=gr.themes.Soft(), head=head_html, css="style_overrides.css",
|
114 |
+
js=force_light_theme_js_func) as application:
|
115 |
repo_val = gr.Textbox(interactive=False, label='repo', visible=False)
|
116 |
hash_val = gr.Textbox(interactive=False, label='hash', visible=False)
|
117 |
shuffled_idx_val = gr.JSON(visible=False)
|
requirements.txt
ADDED
Binary file (2.88 kB). View file
|
|