Amit commited on
Commit
751ed9e
·
1 Parent(s): 0f46d9e

Fix: Use bare gr.Blocks() and inject CSS via HTML

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -620,22 +620,20 @@ button.primary:hover {
620
  """
621
 
622
  # Build the Gradio app
623
- demo = gr.Blocks(
624
- title="Pip - Emotional AI Companion",
625
- css=CUSTOM_CSS
626
- )
627
 
628
  with demo:
629
- # Force dark mode via script
630
- gr.HTML("""
 
631
  <script>
632
  // Force dark theme
633
  document.body.classList.add('dark');
634
  const url = new URL(window.location);
635
- if (url.searchParams.get('__theme') !== 'dark') {
636
  url.searchParams.set('__theme', 'dark');
637
  window.location.replace(url);
638
- }
639
  </script>
640
  """)
641
 
 
620
  """
621
 
622
  # Build the Gradio app
623
+ demo = gr.Blocks()
 
 
 
624
 
625
  with demo:
626
+ # Inject CSS and force dark mode
627
+ gr.HTML(f"""
628
+ <style>{CUSTOM_CSS}</style>
629
  <script>
630
  // Force dark theme
631
  document.body.classList.add('dark');
632
  const url = new URL(window.location);
633
+ if (url.searchParams.get('__theme') !== 'dark') {{
634
  url.searchParams.set('__theme', 'dark');
635
  window.location.replace(url);
636
+ }}
637
  </script>
638
  """)
639