Files
speech/Containerfile
du5t ce064d6894 Add VibeVoice-ASR backend
Third ASR backend option alongside faster-whisper and qwen3. Builds
microsoft/VibeVoice from source (pinned to a specific commit, since it's
custom modeling code not in transformers' Auto* registry) into its own venv,
inheriting the base image's torch/CUDA. Comes with built-in speaker
diarization (VibeVoiceASRProcessor.post_process_transcription returns
per-segment speaker ids directly, no separate pyannote pass needed).

Verified end-to-end against a real recording: 200 OK, correct Korean
transcription, speaker labels populated.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-23 16:54:34 +09:00

61 lines
2.3 KiB
Docker

FROM docker.io/pytorch/pytorch:2.7.0-cuda12.6-cudnn9-runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
WHISPER_CACHE_DIR=/srv/asr/models-cache \
ASR_BASE_DIR=/srv/asr
WORKDIR /app
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libsndfile1 \
curl \
supervisor \
python3-venv \
&& rm -rf /var/lib/apt/lists/*
COPY envs/ /build/envs/
# gateway venv — 경량, GPU 불필요
RUN python -m venv /opt/venvs/gateway && \
/opt/venvs/gateway/bin/pip install --upgrade pip && \
/opt/venvs/gateway/bin/pip install -r /build/envs/gateway.txt
# faster-whisper venv — CTranslate2가 CUDA 직접 처리
RUN python -m venv /opt/venvs/faster_whisper && \
/opt/venvs/faster_whisper/bin/pip install --upgrade pip && \
/opt/venvs/faster_whisper/bin/pip install -r /build/envs/faster_whisper.txt
# qwen3 venv — base image의 torch/CUDA 상속
RUN python -m venv --system-site-packages /opt/venvs/qwen3 && \
/opt/venvs/qwen3/bin/pip install --upgrade pip && \
/opt/venvs/qwen3/bin/pip install -r /build/envs/qwen3.txt
# xtts venv — base image의 torch/CUDA 상속
RUN python -m venv --system-site-packages /opt/venvs/xtts && \
/opt/venvs/xtts/bin/pip install --upgrade pip && \
/opt/venvs/xtts/bin/pip install -r /build/envs/xtts.txt
# vibevoice는 pip 패키지가 아니라 GitHub 소스를 직접 빌드해야 함(커스텀 모델링 코드,
# transformers Auto* 레지스트리에 없음). 특정 커밋에 고정해 업스트림 변경에 흔들리지 않게 함.
RUN apt-get update && apt-get install -y --no-install-recommends git && rm -rf /var/lib/apt/lists/* && \
git clone https://github.com/microsoft/VibeVoice.git /opt/vibevoice_src && \
cd /opt/vibevoice_src && git checkout 303b2833e01cff4578ec278bbfe536da54bd19fe
# vibevoice venv — base image의 torch/CUDA 상속. fastapi/uvicorn/python-multipart는
# vibevoice의 pyproject.toml(직접 의존성 또는 gradio 경유 간접 의존성)으로 이미 호환되는
# 버전이 설치되므로 별도 requirements 파일 불필요.
RUN python -m venv --system-site-packages /opt/venvs/vibevoice && \
/opt/venvs/vibevoice/bin/pip install --upgrade pip && \
/opt/venvs/vibevoice/bin/pip install -e /opt/vibevoice_src
COPY app/ /app/
RUN chmod +x /app/start.sh
EXPOSE 8000
CMD ["/app/start.sh"]