sharsh02 commited on
Commit
e69b5ae
1 Parent(s): 0af53b2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -7
app.py CHANGED
@@ -361,12 +361,16 @@ def generate_function_call(prompt):
361
  # theme = "gary109/HaleyCH_Theme"
362
  # theme = "derekzen/stardust"
363
  # theme = "Taithrah/Minimal"
364
- _js="""
365
- () => {
366
- document.body.classList.toggle('dark');
367
- document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
368
- }
369
- """
 
 
 
 
370
  theme = "rottenlittlecreature/Moon_Goblin"
371
  # theme = "xiaobaiyuan/theme_brief"
372
  # theme = "gary109/Emerald_Isle"
@@ -399,7 +403,7 @@ demo = gr.ChatInterface(
399
  chatbot=my_chatbot,
400
  title="Investor Assistant 🦹‍♂️",
401
  theme=theme,
402
- css = _js
403
  )
404
 
405
  demo.queue().launch(show_api=False)
 
361
  # theme = "gary109/HaleyCH_Theme"
362
  # theme = "derekzen/stardust"
363
  # theme = "Taithrah/Minimal"
364
+ js_func = """
365
+ function refresh() {
366
+ const url = new URL(window.location);
367
+
368
+ if (url.searchParams.get('__theme') !== 'dark') {
369
+ url.searchParams.set('__theme', 'dark');
370
+ window.location.href = url.href;
371
+ }
372
+ }
373
+ """
374
  theme = "rottenlittlecreature/Moon_Goblin"
375
  # theme = "xiaobaiyuan/theme_brief"
376
  # theme = "gary109/Emerald_Isle"
 
403
  chatbot=my_chatbot,
404
  title="Investor Assistant 🦹‍♂️",
405
  theme=theme,
406
+ js= js_func
407
  )
408
 
409
  demo.queue().launch(show_api=False)