Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +16 -8
Dockerfile
CHANGED
|
@@ -2,27 +2,35 @@ FROM python:3.11-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
#
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
# Install system dependencies
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
ffmpeg \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
-
# Install
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
RUN pip install --no-cache-dir \
|
| 15 |
-
|
| 16 |
-
gradio \
|
| 17 |
faster-whisper \
|
| 18 |
huggingface_hub
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
RUN mkdir -p /models
|
| 22 |
-
|
| 23 |
-
# Copy app
|
| 24 |
COPY app.py /app/app.py
|
| 25 |
|
|
|
|
| 26 |
EXPOSE 7860
|
| 27 |
|
|
|
|
| 28 |
CMD ["python", "app.py"]
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
+
# Prevent Python from buffering stdout/stderr
|
| 6 |
ENV PYTHONUNBUFFERED=1
|
| 7 |
|
| 8 |
+
# Set HuggingFace cache to persistent storage
|
| 9 |
+
ENV HF_HOME=/data/.huggingface
|
| 10 |
+
ENV HF_HUB_CACHE=/data/.huggingface/hub
|
| 11 |
+
|
| 12 |
# Install system dependencies
|
| 13 |
RUN apt-get update && apt-get install -y \
|
| 14 |
ffmpeg \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# Install AVX2-optimized llama-cpp-python wheel (2-3x faster!)
|
| 18 |
+
# Fallback to default build if wheel fails
|
| 19 |
+
RUN pip install --no-cache-dir \
|
| 20 |
+
https://huggingface.co/datasets/AIencoder/llama-cpp-wheels/resolve/main/llama_cpp_python-0.3.16-cp311-cp311-manylinux_2_31_x86_64.whl \
|
| 21 |
+
|| pip install --no-cache-dir llama-cpp-python
|
| 22 |
+
|
| 23 |
+
# Install Python dependencies
|
| 24 |
RUN pip install --no-cache-dir \
|
| 25 |
+
gradio>=5.0.0 \
|
|
|
|
| 26 |
faster-whisper \
|
| 27 |
huggingface_hub
|
| 28 |
|
| 29 |
+
# Copy application
|
|
|
|
|
|
|
|
|
|
| 30 |
COPY app.py /app/app.py
|
| 31 |
|
| 32 |
+
# Expose port
|
| 33 |
EXPOSE 7860
|
| 34 |
|
| 35 |
+
# Run the app directly
|
| 36 |
CMD ["python", "app.py"]
|