Clearwave48 commited on
Commit
739e423
Β·
verified Β·
1 Parent(s): 455f45c

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +23 -7
Dockerfile CHANGED
@@ -1,21 +1,24 @@
1
  FROM python:3.10-slim
2
 
 
 
 
3
  RUN apt-get update && apt-get install -y \
4
  ffmpeg git curl \
5
- libgomp1 \
 
6
  && rm -rf /var/lib/apt/lists/*
7
 
 
 
 
8
  WORKDIR /app
9
 
10
- # Install PyTorch CPU first
11
  RUN pip install --no-cache-dir torch torchaudio \
12
  --index-url https://download.pytorch.org/whl/cpu
13
 
14
- # FIX: Install DeepFilterNet separately before other deps
15
- # Pre-built wheels now available β€” no Rust compiler needed
16
- RUN pip install --no-cache-dir deepfilternet
17
-
18
- # Install all other dependencies
19
  RUN pip install --no-cache-dir \
20
  fastapi uvicorn \
21
  requests \
@@ -26,6 +29,15 @@ RUN pip install --no-cache-dir \
26
  librosa ffmpeg-python faster-whisper \
27
  cloudinary
28
 
 
 
 
 
 
 
 
 
 
29
  COPY . .
30
 
31
  RUN useradd -m -u 1000 user
@@ -35,6 +47,10 @@ ENV HF_HOME=/app/.cache/huggingface
35
  ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
36
  ENV HOME=/home/user
37
 
 
 
 
 
38
  EXPOSE 7860
39
 
40
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.10-slim
2
 
3
+ # ── System deps ────────────────────────────────────────────────────────────────
4
+ # Rust + cargo needed for DeepFilterNet (df package)
5
+ # build-essential needed for speechbrain native extensions
6
  RUN apt-get update && apt-get install -y \
7
  ffmpeg git curl \
8
+ build-essential \
9
+ && curl https://sh.rustup.rs -sSf | sh -s -- -y \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Put cargo/rustc on PATH for subsequent RUN steps
13
+ ENV PATH="/root/.cargo/bin:${PATH}"
14
+
15
  WORKDIR /app
16
 
17
+ # ── PyTorch CPU ────────────────────────────────────────────────────────────────
18
  RUN pip install --no-cache-dir torch torchaudio \
19
  --index-url https://download.pytorch.org/whl/cpu
20
 
21
+ # ── Core app deps (unchanged from your original) ──────────────────────────────
 
 
 
 
22
  RUN pip install --no-cache-dir \
23
  fastapi uvicorn \
24
  requests \
 
29
  librosa ffmpeg-python faster-whisper \
30
  cloudinary
31
 
32
+ # ── Denoiser v2 additions ──────────────────────────────────────────────────────
33
+ # DeepFilterNet β€” SOTA noise suppression, now possible because Rust is installed
34
+ # speechbrain β€” SepFormer enhancement model (HF weights, CPU-safe)
35
+ # jellyfish β€” Jaro-Winkler similarity for phonetic stutter detection
36
+ RUN pip install --no-cache-dir \
37
+ deepfilternet \
38
+ speechbrain \
39
+ jellyfish
40
+
41
  COPY . .
42
 
43
  RUN useradd -m -u 1000 user
 
47
  ENV TRANSFORMERS_CACHE=/app/.cache/huggingface
48
  ENV HOME=/home/user
49
 
50
+ # Pre-download DeepFilterNet weights at build time so first request isn't slow
51
+ # (runs as root before USER switch β€” weights land in /app/.cache)
52
+ RUN python -c "from df.enhance import init_df; init_df()" || true
53
+
54
  EXPOSE 7860
55
 
56
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]