nikkmitra commited on
Commit
8a71b86
·
verified ·
1 Parent(s): 11023cf

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -89,8 +89,20 @@ with gr.Blocks() as demo:
89
  outputs=clone_output
90
  )
91
 
 
 
 
 
 
 
 
 
 
 
 
92
  # Launch the interface
93
- demo.launch()
 
94
 
95
  # Clean up temporary files (this will run after the Gradio server is closed)
96
  for file in os.listdir():
 
89
  outputs=clone_output
90
  )
91
 
92
+ js_func = """
93
+ function refresh() {
94
+ const url = new URL(window.location);
95
+
96
+ if (url.searchParams.get('__theme') !== 'dark') {
97
+ url.searchParams.set('__theme', 'dark');
98
+ window.location.href = url.href;
99
+ }
100
+ }
101
+ """
102
+
103
  # Launch the interface
104
+ with gr.Blocks(js=js_func) as demo:
105
+ demo.launch()
106
 
107
  # Clean up temporary files (this will run after the Gradio server is closed)
108
  for file in os.listdir():