potamides commited on
Commit
45060be
1 Parent(s): f838f7e

fix: enforce light theme

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,14 +1,16 @@
1
  from os import getenv
2
  from textwrap import dedent
3
- from torch import cuda
4
 
5
  import gradio as gr
6
- from src.automatikz.examples.webui.webui import build_ui, get_banner
 
 
7
 
8
  PUBLIC_DEMO = getenv("SPACE_ID") == "nllg/AutomaTikZ"
9
 
10
  if PUBLIC_DEMO and not cuda.is_available():
11
- with gr.Blocks(css=".gradio-container {text-align: center}", theme=gr.themes.Soft(), title="AutomaTikZ") as demo:
 
12
  badge = "https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-xl.svg"
13
  link = "https://huggingface.co/spaces/nllg/AutomaTikZ?duplicate=true"
14
  html = f'<a style="display:inline-block" href="{link}"> <img src="{badge}" alt="Duplicate this Space"> </a>'
@@ -20,4 +22,4 @@ if PUBLIC_DEMO and not cuda.is_available():
20
  gr.Markdown(f'{get_banner()}\n{message}\n{html}')
21
  demo.launch()
22
  else:
23
- build_ui(lock=PUBLIC_DEMO).queue().launch(server_name="0.0.0.0", server_port=7860)
 
1
  from os import getenv
2
  from textwrap import dedent
 
3
 
4
  import gradio as gr
5
+ from torch import cuda
6
+
7
+ from src.automatikz.examples.webui.webui import build_ui, remove_darkness, get_banner
8
 
9
  PUBLIC_DEMO = getenv("SPACE_ID") == "nllg/AutomaTikZ"
10
 
11
  if PUBLIC_DEMO and not cuda.is_available():
12
+ center = ".gradio-container {text-align: center}"
13
+ with gr.Blocks(css=center, theme=remove_darkness(gr.themes.Soft()), title="AutomaTikZ") as demo:
14
  badge = "https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-xl.svg"
15
  link = "https://huggingface.co/spaces/nllg/AutomaTikZ?duplicate=true"
16
  html = f'<a style="display:inline-block" href="{link}"> <img src="{badge}" alt="Duplicate this Space"> </a>'
 
22
  gr.Markdown(f'{get_banner()}\n{message}\n{html}')
23
  demo.launch()
24
  else:
25
+ build_ui(lock=PUBLIC_DEMO, force_light=True).queue().launch(server_name="0.0.0.0", server_port=7860)