Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -147,7 +147,17 @@ examples = [
|
|
147 |
theme = gr.themes.Base(
|
148 |
font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
|
149 |
)
|
150 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
151 |
gr.Markdown(MARKDOWN)
|
152 |
gr.DuplicateButton(
|
153 |
value="Duplicate Space for private use",
|
|
|
147 |
theme = gr.themes.Base(
|
148 |
font=[gr.themes.GoogleFont('Libre Franklin'), gr.themes.GoogleFont('Public Sans'), 'system-ui', 'sans-serif'],
|
149 |
)
|
150 |
+
js_func = """
|
151 |
+
function refresh() {
|
152 |
+
const url = new URL(window.location);
|
153 |
+
|
154 |
+
if (url.searchParams.get('__theme') !== 'dark') {
|
155 |
+
url.searchParams.set('__theme', 'dark');
|
156 |
+
window.location.href = url.href;
|
157 |
+
}
|
158 |
+
}
|
159 |
+
"""
|
160 |
+
with gr.Blocks(js=js_func, theme=theme) as demo:
|
161 |
gr.Markdown(MARKDOWN)
|
162 |
gr.DuplicateButton(
|
163 |
value="Duplicate Space for private use",
|