Spaces:
Running on Zero
Running on Zero
Force dark mode
Browse files
app.py
CHANGED
|
@@ -48,6 +48,18 @@ BIBTEX = """@misc{dipta2026oraclezoomonpolicyselfdistillationinspired,
|
|
| 48 |
url = {https://arxiv.org/abs/2609.06490}
|
| 49 |
}"""
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
CSS = """
|
| 52 |
#hero video {border-radius:12px}
|
| 53 |
.contain {max-width:1400px !important}
|
|
@@ -181,7 +193,7 @@ def _example_scale_options():
|
|
| 181 |
return scale_choices(len(EXAMPLE_LEVELS) - 1)
|
| 182 |
|
| 183 |
|
| 184 |
-
with gr.Blocks(theme=gr.themes.Soft(primary_hue="amber"), css=CSS,
|
| 185 |
title="OracleZoom: zoom past 256x") as demo:
|
| 186 |
gr.HTML(HEADER)
|
| 187 |
# Inputs down the left, results down the right. Both columns carry real content the whole
|
|
|
|
| 48 |
url = {https://arxiv.org/abs/2609.06490}
|
| 49 |
}"""
|
| 50 |
|
| 51 |
+
# Dark only. Gradio otherwise follows the visitor's system setting, and the light theme washes
|
| 52 |
+
# the amber accents out against the photos. One redirect on first load, then it sticks.
|
| 53 |
+
FORCE_DARK = """
|
| 54 |
+
() => {
|
| 55 |
+
const url = new URL(window.location);
|
| 56 |
+
if (url.searchParams.get('__theme') !== 'dark') {
|
| 57 |
+
url.searchParams.set('__theme', 'dark');
|
| 58 |
+
window.location.replace(url.href);
|
| 59 |
+
}
|
| 60 |
+
}
|
| 61 |
+
"""
|
| 62 |
+
|
| 63 |
CSS = """
|
| 64 |
#hero video {border-radius:12px}
|
| 65 |
.contain {max-width:1400px !important}
|
|
|
|
| 193 |
return scale_choices(len(EXAMPLE_LEVELS) - 1)
|
| 194 |
|
| 195 |
|
| 196 |
+
with gr.Blocks(theme=gr.themes.Soft(primary_hue="amber"), css=CSS, js=FORCE_DARK,
|
| 197 |
title="OracleZoom: zoom past 256x") as demo:
|
| 198 |
gr.HTML(HEADER)
|
| 199 |
# Inputs down the left, results down the right. Both columns carry real content the whole
|