Spaces:
Runtime error
Runtime error
Commit ·
1680b8f
1
Parent(s): 36edd4c
asfads
Browse files- Dockerfile +7 -1
- requirements.txt +4 -1
Dockerfile
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
FROM nvidia/cuda:12.0.0-cudnn8-devel-ubuntu22.04
|
| 2 |
|
|
|
|
| 3 |
# 1) Variables HF avant tout
|
| 4 |
ENV HF_HOME="/home/user/.cache/huggingface" \
|
| 5 |
HF_HUB_CACHE="/home/user/.cache/huggingface/hub" \
|
|
@@ -8,6 +9,11 @@ ENV HF_HOME="/home/user/.cache/huggingface" \
|
|
| 8 |
# 2) Créer l’utilisateur non-root
|
| 9 |
RUN useradd -m -u 1000 user
|
| 10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
# 3) Installer dépendances système
|
| 12 |
RUN apt-get update && apt-get install -y \
|
| 13 |
build-essential git libpoppler-cpp-dev poppler-utils libmagic-dev python3-dev \
|
|
@@ -16,7 +22,7 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
# 4) Copier requirements et installer libs Python
|
| 17 |
WORKDIR /home/user/app
|
| 18 |
COPY --chown=user requirements.txt .
|
| 19 |
-
RUN pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/
|
| 20 |
RUN pip install --no-cache-dir huggingface_hub
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
|
|
|
| 1 |
FROM nvidia/cuda:12.0.0-cudnn8-devel-ubuntu22.04
|
| 2 |
|
| 3 |
+
|
| 4 |
# 1) Variables HF avant tout
|
| 5 |
ENV HF_HOME="/home/user/.cache/huggingface" \
|
| 6 |
HF_HUB_CACHE="/home/user/.cache/huggingface/hub" \
|
|
|
|
| 9 |
# 2) Créer l’utilisateur non-root
|
| 10 |
RUN useradd -m -u 1000 user
|
| 11 |
|
| 12 |
+
RUN apt-get update && \
|
| 13 |
+
apt-get install -y --no-install-recommends \
|
| 14 |
+
python3 python3-pip python3-dev && \
|
| 15 |
+
rm -rf /var/lib/apt/lists/*
|
| 16 |
+
|
| 17 |
# 3) Installer dépendances système
|
| 18 |
RUN apt-get update && apt-get install -y \
|
| 19 |
build-essential git libpoppler-cpp-dev poppler-utils libmagic-dev python3-dev \
|
|
|
|
| 22 |
# 4) Copier requirements et installer libs Python
|
| 23 |
WORKDIR /home/user/app
|
| 24 |
COPY --chown=user requirements.txt .
|
| 25 |
+
RUN pip install --no-cache-dir torch torchvision --extra-index-url https://download.pytorch.org/whl/cu118
|
| 26 |
RUN pip install --no-cache-dir huggingface_hub
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
requirements.txt
CHANGED
|
@@ -1,5 +1,8 @@
|
|
| 1 |
--extra-index-url https://download.pytorch.org/whl/cu118
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
| 3 |
annotated-types==0.7.0
|
| 4 |
attrs==25.3.0
|
| 5 |
beautifulsoup4==4.13.4
|
|
|
|
| 1 |
--extra-index-url https://download.pytorch.org/whl/cu118
|
| 2 |
+
|
| 3 |
+
torch==2.2.2+cu118
|
| 4 |
+
torchvision==0.17.2+cu118
|
| 5 |
+
torchaudio==2.2.2+cu118
|
| 6 |
annotated-types==0.7.0
|
| 7 |
attrs==25.3.0
|
| 8 |
beautifulsoup4==4.13.4
|