Files changed (1) hide show
  1. app.py +17 -7
app.py CHANGED
@@ -7,6 +7,14 @@ from typing import Dict, Any, List, Optional
7
  import gradio as gr
8
  from huggingface_hub import InferenceClient
9
 
 
 
 
 
 
 
 
 
10
  # ────────────────────────────────────────────────────────────────────────────────
11
  # CONFIG
12
 
@@ -688,9 +696,11 @@ def update_cards(lang: str, category_choice: str, variant: str, seen: List[str])
688
  # GRADIO APP
689
 
690
 
691
- with gr.Blocks(title="Neurovie – Question Studio") as demo:
692
- # Load external CSS file
693
- gr.HTML("<link rel='stylesheet' href='style.css'>")
 
 
694
 
695
  seen_state = gr.State([]) # per-session list of seen questions
696
 
@@ -761,10 +771,10 @@ with gr.Blocks(title="Neurovie – Question Studio") as demo:
761
 
762
 
763
  btn.click(
764
- update_cards,
765
- [lang, category, variant, seen_state],
766
- [q1, q2, q3, q4, m1, m2, seen_state],
767
- show_progress=False, # hide Gradio built-in progress indicator
768
  )
769
 
770
 
 
7
  import gradio as gr
8
  from huggingface_hub import InferenceClient
9
 
10
+ # Load external CSS file into a string so Gradio can inject it
11
+ CSS_PATH = os.path.join(os.path.dirname(__file__), "style.css")
12
+ try:
13
+ with open(CSS_PATH, encoding="utf-8") as f:
14
+ CUSTOM_CSS = f.read()
15
+ except FileNotFoundError:
16
+ CUSTOM_CSS = ""
17
+
18
  # ────────────────────────────────────────────────────────────────────────────────
19
  # CONFIG
20
 
 
696
  # GRADIO APP
697
 
698
 
699
+ with gr.Blocks(
700
+ title="Neurovie – Question Studio",
701
+ css=CUSTOM_CSS, # <- inject CSS content here
702
+ ) as demo:
703
+ # no need for gr.HTML("<link ...>")
704
 
705
  seen_state = gr.State([]) # per-session list of seen questions
706
 
 
771
 
772
 
773
  btn.click(
774
+ update_cards,
775
+ [lang, category, variant, seen_state],
776
+ [q1, q2, q3, q4, m1, m2, seen_state],
777
+ show_progress=False, # hide Gradio built-in progress indicator
778
  )
779
 
780