Files
TalkEdit/Dockerfile.gpu
Your Name c5cc7c2969 fix: Update PyTorch/torchaudio to 2.1.0 for SpeechBrain 1.0 diarization compatibility
- Update torch from 2.0.1 to 2.1.0
- Update torchaudio from 2.0.2 to 2.1.0 (fixes 'NoneType' object has no attribute 'eval' error)
- Update torchvision from 0.15.2 to 0.16.0
- Update pytorch-lightning from 2.0.6 to 2.1.0
- Add explicit speechbrain==1.0.0 dependency
- Update transformers and tokenizers for compatibility
- Update protobuf version constraint

Fixes diarization error: speechbrain.pretrained was deprecated and redirected to speechbrain.inference in SpeechBrain 1.0, but required torchaudio >= 2.1.0
2026-01-05 09:57:20 -05:00

54 lines
1.5 KiB
Docker

FROM python:3.11-slim
# Set working directory
WORKDIR /app
# Install system dependencies including CUDA-related packages
RUN apt-get update && apt-get install -y \
ffmpeg \
git \
wget \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better Docker layer caching
COPY requirements.txt .
# Install CPU versions from requirements.txt first
RUN pip install --no-cache-dir -r requirements.txt
# Install CUDA-optimized PyTorch (overwrites CPU versions)
# Updated to torch 2.1.0+ for SpeechBrain 1.0 / pyannote diarization compatibility
RUN pip install --force-reinstall \
torch==2.1.0+cu118 \
torchvision==0.16.0+cu118 \
torchaudio==2.1.0+cu118 \
--index-url https://download.pytorch.org/whl/cu118
# Copy application code
COPY . .
# Create directories for mounted volumes
RUN mkdir -p /app/data/videos /app/data/outputs /app/data/cache
# Set environment variables
ENV STREAMLIT_SERVER_PORT=8501
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
# GPU-specific environment variables
ENV CUDA_VISIBLE_DEVICES=0
ENV NVIDIA_VISIBLE_DEVICES=all
ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility
# Expose Streamlit port
EXPOSE 8501
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD curl -f http://localhost:8501/_stcore/health || exit 1
# Start the application
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]