From 8aa42e6fcb9eb66d7e531455ab750426efa6dd48 Mon Sep 17 00:00:00 2001 From: Pluto Date: Thu, 28 May 2026 13:17:32 -0500 Subject: [PATCH] fix: add gcc/build-essential for webrtcvad, drop silero-vad pip install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit resemblyzer depends on webrtcvad which compiles C extensions — gcc and build-essential are required in slim containers. silero-vad pip package has a broken native .so in python:3.12-slim; VAD model is now loaded at runtime via torch.hub.load() which downloads on first use. Co-Authored-By: Claude Sonnet 4.6 --- cron/Dockerfile | 4 +++- pipeline/Dockerfile | 12 +++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cron/Dockerfile b/cron/Dockerfile index 6fd899d..455fbc5 100644 --- a/cron/Dockerfile +++ b/cron/Dockerfile @@ -1,10 +1,12 @@ FROM python:3.12-slim RUN apt-get update && apt-get install -y --no-install-recommends \ - libsndfile1 && rm -rf /var/lib/apt/lists/* + libsndfile1 gcc build-essential && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY pyproject.toml . +# Install torch CPU-only, resemblyzer, and cron deps +# silero-vad pip package excluded — not needed in cron (no VAD processing) RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \ pip install --no-cache-dir resemblyzer scipy numpy httpx pydantic-settings diff --git a/pipeline/Dockerfile b/pipeline/Dockerfile index 961aa62..cd2e552 100644 --- a/pipeline/Dockerfile +++ b/pipeline/Dockerfile @@ -1,20 +1,22 @@ FROM python:3.12-slim RUN apt-get update && apt-get install -y --no-install-recommends \ - ffmpeg libsndfile1 && rm -rf /var/lib/apt/lists/* + ffmpeg libsndfile1 gcc build-essential && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY pyproject.toml . +# Install torch CPU-only first (avoids pulling GPU variant), then rest of deps +# silero-vad pip package excluded — runtime uses torch.hub.load instead RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu && \ - pip install --no-cache-dir resemblyzer silero-vad scipy numpy && \ + pip install --no-cache-dir resemblyzer scipy numpy && \ pip install --no-cache-dir fastapi uvicorn[standard] pydantic-settings httpx websockets livekit-api COPY app/ app/ -# Pre-download VAD and resemblyzer models into the image -RUN python -c "import torch; torch.hub.load('snakers4/silero-vad', 'silero_vad', trust_repo=True)" && \ - python -c "from resemblyzer import VoiceEncoder; VoiceEncoder()" +# Pre-download resemblyzer model (VoiceEncoder downloads ~25MB pretrained weights) +RUN python -c "from resemblyzer import VoiceEncoder; VoiceEncoder()" +# Note: silero-vad model downloads lazily at first container startup via torch.hub ENV PYTHONUNBUFFERED=1 CMD ["python", "-m", "uvicorn", "app.pipeline.main:app", "--host", "0.0.0.0", "--port", "8300"]