Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +9 -11
Dockerfile
CHANGED
|
@@ -18,32 +18,30 @@ ENV OMP_NUM_THREADS=1 \
|
|
| 18 |
NVIDIA_VISIBLE_DEVICES=all \
|
| 19 |
NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
| 20 |
|
|
|
|
| 21 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 22 |
python3 python3-pip git git-lfs ca-certificates && \
|
| 23 |
rm -rf /var/lib/apt/lists/* && \
|
| 24 |
git lfs install
|
| 25 |
|
|
|
|
| 26 |
RUN python3 -m pip install --upgrade pip
|
| 27 |
-
|
| 28 |
RUN python3 -m pip install --no-cache-dir \
|
| 29 |
--index-url https://download.pytorch.org/whl/cu121 \
|
| 30 |
-
torch==2.
|
| 31 |
-
|
| 32 |
-
RUN python3 -m pip install --no-cache-dir faiss-gpu==1.7.2
|
| 33 |
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
huggingface_hub>=0.14.1
|
| 37 |
|
|
|
|
| 38 |
COPY requirements.txt .
|
| 39 |
RUN python3 -m pip install --no-cache-dir -r requirements.txt
|
| 40 |
|
| 41 |
-
|
| 42 |
-
|
| 43 |
COPY . .
|
| 44 |
|
|
|
|
| 45 |
RUN mkdir -p "$OFFLOAD_DIR" "$MERGED_MODEL_DIR" "$HF_HOME" "$TRANSFORMERS_CACHE"
|
| 46 |
|
| 47 |
EXPOSE 7860
|
| 48 |
-
|
| 49 |
-
CMD ["python3", "app.py"]
|
|
|
|
| 18 |
NVIDIA_VISIBLE_DEVICES=all \
|
| 19 |
NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
| 20 |
|
| 21 |
+
# Base OS deps
|
| 22 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 23 |
python3 python3-pip git git-lfs ca-certificates && \
|
| 24 |
rm -rf /var/lib/apt/lists/* && \
|
| 25 |
git lfs install
|
| 26 |
|
| 27 |
+
# Modern torch stack aligned to cu121 and Transformers 4.44.x
|
| 28 |
RUN python3 -m pip install --upgrade pip
|
|
|
|
| 29 |
RUN python3 -m pip install --no-cache-dir \
|
| 30 |
--index-url https://download.pytorch.org/whl/cu121 \
|
| 31 |
+
torch==2.3.1 torchvision==0.18.1 torchaudio==2.3.1
|
|
|
|
|
|
|
| 32 |
|
| 33 |
+
# NOTE: Do NOT install faiss-gpu. We keep CPU FAISS only (from requirements.txt).
|
| 34 |
+
# (Removing: python3 -m pip install faiss-gpu==1.7.2)
|
|
|
|
| 35 |
|
| 36 |
+
# App requirements (single source of truth)
|
| 37 |
COPY requirements.txt .
|
| 38 |
RUN python3 -m pip install --no-cache-dir -r requirements.txt
|
| 39 |
|
| 40 |
+
# App code
|
|
|
|
| 41 |
COPY . .
|
| 42 |
|
| 43 |
+
# Needed dirs
|
| 44 |
RUN mkdir -p "$OFFLOAD_DIR" "$MERGED_MODEL_DIR" "$HF_HOME" "$TRANSFORMERS_CACHE"
|
| 45 |
|
| 46 |
EXPOSE 7860
|
| 47 |
+
CMD ["python3", "app.py"]
|
|
|