potamides commited on
Commit
c2cb9cb
1 Parent(s): 134a65a

feat: initial commit

Browse files
Files changed (4) hide show
  1. README.md +2 -1
  2. app.py +21 -0
  3. packages.txt +3 -0
  4. requirements.txt +1 -0
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  title: AutomaTikZ
3
- emoji: 🐨
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: gradio
@@ -8,6 +8,7 @@ sdk_version: 3.47.1
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
 
11
  ---
12
 
13
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
  title: AutomaTikZ
3
+ emoji: 🏝️
4
  colorFrom: blue
5
  colorTo: indigo
6
  sdk: gradio
 
8
  app_file: app.py
9
  pinned: false
10
  license: apache-2.0
11
+ suggested_hardware: a100-large
12
  ---
13
 
14
  Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from os import getenv
2
+ from textwrap import dedent
3
+
4
+ import gradio as gr
5
+ from src.automatikz.examples.webui.webui import build_ui, get_banner
6
+
7
+ if getenv("SPACE_ID") == "nllg/AutomaTikZ":
8
+ with gr.Blocks(css=".gradio-container {text-align: center}", theme=gr.themes.Soft()) as demo:
9
+ badge = "https://huggingface.co/datasets/huggingface/badges/resolve/main/duplicate-this-space-xl.svg"
10
+ link = "https://huggingface.co/spaces/nllg/AutomaTikZ?duplicate=true"
11
+ html = f'<a style="display:inline-block" href="{link}"> <img src="{badge}" alt="Duplicate this Space"> </a>'
12
+ message = dedent("""\
13
+ Unfortunately, the resource limitations of free Hugging Face Spaces
14
+ prevent the full model from running. To access the complete
15
+ capabilities, we recommend duplicating this space to a paid private GPU
16
+ runtime.
17
+ """)
18
+ gr.Markdown(f'{get_banner()}\n{message}\n{html}')
19
+ demo.launch()
20
+ else:
21
+ build_ui().queue().launch()
packages.txt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ texlive-full
2
+ ghostscript
3
+ poppler-utils
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ -e git+https://github.com/potamides/AutomaTikZ#egg=automatikz[webui]