OrbitMC commited on
Commit
00e173b
·
verified ·
1 Parent(s): 28c6b1e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -15
Dockerfile CHANGED
@@ -1,14 +1,12 @@
1
  FROM python:3.11-slim
2
 
3
- # Force logs to show up instantly in Hugging Face
4
- ENV PYTHONUNBUFFERED=1
5
-
6
- # Install only the system dependency needed for edge-tts (audio)
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  ffmpeg \
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- # Set up the Hugging Face user
12
  RUN useradd -m -u 1000 user
13
  USER user
14
  ENV PATH="/home/user/.local/bin:$PATH"
@@ -16,21 +14,20 @@ ENV HF_HOME="/home/user/.cache/huggingface"
16
 
17
  WORKDIR /home/user/app
18
 
19
- # Install standard Python libraries (No llama.cpp, no C++ compiling)
 
20
  RUN pip install --no-cache-dir --upgrade pip && \
21
- pip install --no-cache-dir \
22
- torch==2.6.0+cpu --extra-index-url https://download.pytorch.org/whl/cpu \
23
- "transformers>=4.49.0" \
24
- "accelerate>=1.3.0" \
25
- "gguf>=0.10.0" \
26
  flask==3.1.1 \
 
27
  edge-tts \
28
- num2words==0.5.14 \
29
- "huggingface_hub>=0.27.0" \
30
- "numpy<2.0"
31
 
32
  COPY --chown=user:user . .
33
 
34
  EXPOSE 7860
35
 
36
- CMD["python", "app.py"]
 
1
  FROM python:3.11-slim
2
 
3
+ # Install system dependencies (ffmpeg is useful for audio manipulation if needed)
 
 
 
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
  ffmpeg \
6
+ git \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # HF Spaces requires uid 1000
10
  RUN useradd -m -u 1000 user
11
  USER user
12
  ENV PATH="/home/user/.local/bin:$PATH"
 
14
 
15
  WORKDIR /home/user/app
16
 
17
+ # Combine Requirements into Dockerfile
18
+ # Using PyTorch CPU-only to save space
19
  RUN pip install --no-cache-dir --upgrade pip && \
20
+ pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu \
21
+ torch==2.6.0+cpu \
22
+ transformers>=4.49.0 \
23
+ accelerate>=1.3.0 \
 
24
  flask==3.1.1 \
25
+ huggingface_hub>=0.27.0 \
26
  edge-tts \
27
+ asyncio
 
 
28
 
29
  COPY --chown=user:user . .
30
 
31
  EXPOSE 7860
32
 
33
+ CMD ["python", "app.py"]