AIencoder commited on
Commit
d17c108
·
verified ·
1 Parent(s): 1ecbdcf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -8
Dockerfile CHANGED
@@ -2,27 +2,35 @@ FROM python:3.11-slim
2
 
3
  WORKDIR /app
4
 
5
- # Force unbuffered output so logs show immediately
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 your wheel + dependencies
 
 
 
 
 
 
14
  RUN pip install --no-cache-dir \
15
- 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 \
16
- gradio \
17
  faster-whisper \
18
  huggingface_hub
19
 
20
- # Create models directory
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"]