diff --git a/Dockerfile.gpu b/Dockerfile.gpu index 2684e16..8d48888 100644 --- a/Dockerfile.gpu +++ b/Dockerfile.gpu @@ -15,16 +15,17 @@ RUN apt-get update && apt-get install -y \ # 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 +# Upgrade pip first to avoid installation issues +RUN pip install --upgrade pip -# 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 +# Install CUDA-optimized PyTorch FIRST (before other requirements) +# Using latest versions from cu118 index for SpeechBrain 1.0 / pyannote diarization compatibility +# Not pinning versions - pip will resolve latest compatible versions from the index +RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 + +# Install remaining dependencies from requirements.txt +# Skip torch/torchvision/torchaudio since they're already installed +RUN pip install --no-cache-dir -r requirements.txt # Copy application code COPY . . diff --git a/requirements.txt b/requirements.txt index e419794..10aab87 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,9 +8,10 @@ humanize>=4.6.0 # PyTorch ecosystem - updated for SpeechBrain 1.0 compatibility # torchaudio >= 2.1.0 is REQUIRED for diarization to work properly -torch==2.1.0 -torchaudio==2.1.0 -torchvision==0.16.0 +# NOTE: For Docker GPU builds, these are installed separately from cu118 index +torch>=2.1.0 +torchaudio>=2.1.0 +torchvision>=0.16.0 # Transformers ecosystem - compatible versions transformers==4.35.0