Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +16 -1
Dockerfile
CHANGED
|
@@ -2,12 +2,26 @@ FROM python:3.11-slim
|
|
| 2 |
|
| 3 |
WORKDIR /
|
| 4 |
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
curl \
|
| 7 |
ffmpeg \
|
| 8 |
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
|
| 10 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
RUN pip install https://github.com/Ary5272/llama-cpp-python/releases/download/v0.1.1/llama_cpp_python-0.3.16-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl \
|
| 12 |
|| pip install https://huggingface.co/datasets/AIencoder/llama-cpp-wheels/resolve/main/llama_cpp_python-0.3.16-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
|
| 13 |
|
|
@@ -16,6 +30,7 @@ RUN pip install \
|
|
| 16 |
faster-whisper \
|
| 17 |
huggingface_hub
|
| 18 |
|
|
|
|
| 19 |
COPY app.py /app.py
|
| 20 |
COPY entrypoint.sh /entrypoint.sh
|
| 21 |
RUN chmod +x /entrypoint.sh
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /
|
| 4 |
|
| 5 |
+
# 1. Install system tools (Keep your existing dependencies)
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
curl \
|
| 8 |
ffmpeg \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
+
# --- START OF FIX ---
|
| 12 |
+
# 2. Create cache directories on the large /data volume and set permissions [cite: 11]
|
| 13 |
+
RUN mkdir -p /data/.cache/huggingface \
|
| 14 |
+
/data/.huggingface \
|
| 15 |
+
&& chmod -R 777 /data
|
| 16 |
+
|
| 17 |
+
# 3. Tell Hugging Face to use the /data folder for storage [cite: 11]
|
| 18 |
+
ENV HF_HOME=/data/.huggingface
|
| 19 |
+
ENV HF_DATASETS_CACHE=/data/.cache/huggingface/datasets
|
| 20 |
+
ENV TRANSFORMERS_CACHE=/data/.cache/huggingface/transformers
|
| 21 |
+
# --- END OF FIX ---
|
| 22 |
+
|
| 23 |
+
# 4. Install your python libraries (Keep your existing wheels and requirements)
|
| 24 |
+
# Try GitHub first, fallback to HuggingFace
|
| 25 |
RUN pip install https://github.com/Ary5272/llama-cpp-python/releases/download/v0.1.1/llama_cpp_python-0.3.16-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl \
|
| 26 |
|| pip install https://huggingface.co/datasets/AIencoder/llama-cpp-wheels/resolve/main/llama_cpp_python-0.3.16-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
|
| 27 |
|
|
|
|
| 30 |
faster-whisper \
|
| 31 |
huggingface_hub
|
| 32 |
|
| 33 |
+
# 5. Copy app files and start
|
| 34 |
COPY app.py /app.py
|
| 35 |
COPY entrypoint.sh /entrypoint.sh
|
| 36 |
RUN chmod +x /entrypoint.sh
|