Spaces:
Running
on
L4
Running
on
L4
Update for DeTikZify v2
Browse files- Dockerfile +5 -1
- README.md +0 -5
- app.py +1 -1
Dockerfile
CHANGED
@@ -68,13 +68,17 @@ RUN pyenv install 3.11 \
|
|
68 |
&& pyenv global 3.11 \
|
69 |
&& pyenv rehash \
|
70 |
&& pip install --no-cache-dir --upgrade setuptools wheel \
|
71 |
-
&& pip install --no-cache-dir 'detikzify @ git+https://github.com/potamides/DeTikZify' \
|
72 |
&& pip install --no-cache-dir flash-attn --no-build-isolation \
|
73 |
&& pip install --no-cache-dir spaces
|
74 |
|
75 |
RUN chown -R user $HOME/app
|
76 |
COPY --chown=user . $HOME/app
|
77 |
|
|
|
|
|
|
|
|
|
78 |
## launch app
|
79 |
# -----------------------------------------------------------------------------
|
80 |
USER user
|
|
|
68 |
&& pyenv global 3.11 \
|
69 |
&& pyenv rehash \
|
70 |
&& pip install --no-cache-dir --upgrade setuptools wheel \
|
71 |
+
&& pip install --no-cache-dir 'detikzify[legacy] @ git+https://github.com/potamides/DeTikZify' \
|
72 |
&& pip install --no-cache-dir flash-attn --no-build-isolation \
|
73 |
&& pip install --no-cache-dir spaces
|
74 |
|
75 |
RUN chown -R user $HOME/app
|
76 |
COPY --chown=user . $HOME/app
|
77 |
|
78 |
+
## preload v2 models
|
79 |
+
# -----------------------------------------------------------------------------
|
80 |
+
RUN huggingface-cli download nllg/detikzify-v2-8b
|
81 |
+
|
82 |
## launch app
|
83 |
# -----------------------------------------------------------------------------
|
84 |
USER user
|
README.md
CHANGED
@@ -7,11 +7,6 @@ sdk: docker
|
|
7 |
pinned: false
|
8 |
license: apache-2.0
|
9 |
suggested_hardware: a10g-small
|
10 |
-
startup_duration_timeout: 1h
|
11 |
-
preload_from_hub:
|
12 |
-
- timm/ViT-SO400M-14-SigLIP-384
|
13 |
-
- nllg/detikzify-ds-7b
|
14 |
-
- nllg/detikzify-ds-1.3b
|
15 |
---
|
16 |
|
17 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
7 |
pinned: false
|
8 |
license: apache-2.0
|
9 |
suggested_hardware: a10g-small
|
|
|
|
|
|
|
|
|
|
|
10 |
---
|
11 |
|
12 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
@@ -32,7 +32,7 @@ if is_official_demo() and not cuda.is_available():
|
|
32 |
gr.HTML(f'{BANNER}\n<p>{message}</p>\n{html}')
|
33 |
else:
|
34 |
use_big_models = cuda.is_available() and cuda.get_device_properties(0).total_memory > 15835660288
|
35 |
-
model = f"detikzify-
|
36 |
demo = build_ui(lock=is_official_demo(), model=model, light=True).queue()
|
37 |
# Hack to temporarily work around memory leak, see:
|
38 |
# * https://huggingface.co/spaces/nllg/DeTikZify/discussions/2
|
|
|
32 |
gr.HTML(f'{BANNER}\n<p>{message}</p>\n{html}')
|
33 |
else:
|
34 |
use_big_models = cuda.is_available() and cuda.get_device_properties(0).total_memory > 15835660288
|
35 |
+
model = f"detikzify-{'v2-8b' if use_big_models else 'ds-1.3b'}"
|
36 |
demo = build_ui(lock=is_official_demo(), model=model, light=True).queue()
|
37 |
# Hack to temporarily work around memory leak, see:
|
38 |
# * https://huggingface.co/spaces/nllg/DeTikZify/discussions/2
|