Update app.py
Browse files
app.py
CHANGED
|
@@ -3,5 +3,16 @@ import gradio as gr
|
|
| 3 |
|
| 4 |
#os.environ["HF_TOKEN"] = os.getenv('demo_gradioapp')
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
demo = gr.load("PCTseng/EFP_Demo", src="spaces", hf_token = os.getenv('demo_gradioapp')).render()
|
| 7 |
-
demo.queue().launch(auth=('demo',os.getenv('password')), share=True, ssr_mode=False)
|
|
|
|
| 3 |
|
| 4 |
#os.environ["HF_TOKEN"] = os.getenv('demo_gradioapp')
|
| 5 |
|
| 6 |
+
js_dark_theme = """
|
| 7 |
+
function refresh() {
|
| 8 |
+
const url = new URL(window.location);
|
| 9 |
+
if (url.searchParams.get('__theme') !== 'dark') {
|
| 10 |
+
url.searchParams.set('__theme', 'dark');
|
| 11 |
+
window.location.href = url.href;
|
| 12 |
+
}
|
| 13 |
+
}
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
|
| 17 |
demo = gr.load("PCTseng/EFP_Demo", src="spaces", hf_token = os.getenv('demo_gradioapp')).render()
|
| 18 |
+
demo.queue().launch(auth=('demo',os.getenv('password')), share=True, ssr_mode=False, js=js_dark_theme)
|