Spaces:
Runtime error
Runtime error
Commit ·
a3a70b9
1
Parent(s): 088728e
comment out artifacts
Browse files- Dockerfile +4 -7
Dockerfile
CHANGED
|
@@ -3,9 +3,8 @@ FROM python:3.10-slim
|
|
| 3 |
# 1) Variables HF avant tout
|
| 4 |
ENV HF_HOME="/home/user/.cache/huggingface" \
|
| 5 |
HF_HUB_CACHE="/home/user/.cache/huggingface/hub" \
|
| 6 |
-
TRANSFORMERS_CACHE="/home/user/.cache/huggingface/transformers"
|
| 7 |
-
DOCLING_ARTIFACTS_PATH="/home/user/.cache/docling/models"
|
| 8 |
-
OMP_NUM_THREADS=2
|
| 9 |
|
| 10 |
|
| 11 |
# 2) Créer l’utilisateur non-root
|
|
@@ -23,9 +22,6 @@ RUN pip install --no-cache-dir torch torchvision --extra-index-url https://downl
|
|
| 23 |
RUN pip install --no-cache-dir huggingface_hub
|
| 24 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
-
# sous l’utilisateur non-root
|
| 27 |
-
USER user
|
| 28 |
-
|
| 29 |
# 4-bis) Install Docling and prefetch its models
|
| 30 |
RUN pip install --no-cache-dir docling \
|
| 31 |
&& docling-tools models download
|
|
@@ -34,7 +30,8 @@ RUN pip install --no-cache-dir docling \
|
|
| 34 |
RUN mkdir -p /home/user/app/model_cache $HF_HUB_CACHE \
|
| 35 |
&& chown -R user:user /home/user/app /home/user/.cache/huggingface
|
| 36 |
|
| 37 |
-
# 6) Télécharger le modèle au build-time
|
|
|
|
| 38 |
RUN python - <<EOF
|
| 39 |
import os
|
| 40 |
from huggingface_hub import snapshot_download
|
|
|
|
| 3 |
# 1) Variables HF avant tout
|
| 4 |
ENV HF_HOME="/home/user/.cache/huggingface" \
|
| 5 |
HF_HUB_CACHE="/home/user/.cache/huggingface/hub" \
|
| 6 |
+
TRANSFORMERS_CACHE="/home/user/.cache/huggingface/transformers"
|
| 7 |
+
# ENV DOCLING_ARTIFACTS_PATH="/home/user/.cache/docling/models"
|
|
|
|
| 8 |
|
| 9 |
|
| 10 |
# 2) Créer l’utilisateur non-root
|
|
|
|
| 22 |
RUN pip install --no-cache-dir huggingface_hub
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
|
|
|
|
|
|
|
|
|
| 25 |
# 4-bis) Install Docling and prefetch its models
|
| 26 |
RUN pip install --no-cache-dir docling \
|
| 27 |
&& docling-tools models download
|
|
|
|
| 30 |
RUN mkdir -p /home/user/app/model_cache $HF_HUB_CACHE \
|
| 31 |
&& chown -R user:user /home/user/app /home/user/.cache/huggingface
|
| 32 |
|
| 33 |
+
# 6) Télécharger le modèle au build-time sous l’utilisateur non-root
|
| 34 |
+
USER user
|
| 35 |
RUN python - <<EOF
|
| 36 |
import os
|
| 37 |
from huggingface_hub import snapshot_download
|