From 78e9df31e6cc70e99441ce6d551ae84831a52266 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 5 Jan 2026 10:50:20 -0500 Subject: [PATCH] fix: Use flexible PyTorch versions and fix Docker build order - Don't pin exact torch/torchaudio/torchvision versions (use >=2.1.0) - Install CUDA PyTorch first in Docker before other requirements - Upgrade pip before installations to avoid compatibility issues - Let pip resolve latest compatible versions from cu118 index --- Dockerfile.gpu | 19 ++++++++++--------- requirements.txt | 7 ++++--- 2 files changed, 14 insertions(+), 12 deletions(-) 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