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
This commit is contained in:
Your Name
2026-01-05 09:57:20 -05:00
parent 81f40726e3
commit c5cc7c2969
3 changed files with 16 additions and 12 deletions

View File

@ -20,7 +20,7 @@ RUN pip install --no-cache-dir -r requirements.txt
# Optional: Install CUDA-specific PyTorch if GPU support needed # Optional: Install CUDA-specific PyTorch if GPU support needed
# Uncomment and modify for your CUDA version: # Uncomment and modify for your CUDA version:
# RUN pip install --force-reinstall torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 # 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 application code
COPY . . COPY . .

View File

@ -19,10 +19,11 @@ COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt RUN pip install --no-cache-dir -r requirements.txt
# Install CUDA-optimized PyTorch (overwrites CPU versions) # 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 \ RUN pip install --force-reinstall \
torch==2.0.1+cu118 \ torch==2.1.0+cu118 \
torchvision==0.15.2+cu118 \ torchvision==0.16.0+cu118 \
torchaudio==2.0.2+cu118 \ torchaudio==2.1.0+cu118 \
--index-url https://download.pytorch.org/whl/cu118 --index-url https://download.pytorch.org/whl/cu118
# Copy application code # Copy application code

View File

@ -6,14 +6,15 @@ openai-whisper==20231117
requests>=2.28.0 requests>=2.28.0
humanize>=4.6.0 humanize>=4.6.0
# PyTorch ecosystem - pinned for compatibility # PyTorch ecosystem - updated for SpeechBrain 1.0 compatibility
torch==2.0.1 # torchaudio >= 2.1.0 is REQUIRED for diarization to work properly
torchaudio==2.0.2 torch==2.1.0
torchvision==0.15.2 torchaudio==2.1.0
torchvision==0.16.0
# Transformers ecosystem - compatible versions # Transformers ecosystem - compatible versions
transformers==4.30.2 transformers==4.35.0
tokenizers==0.13.3 tokenizers>=0.14.0
# ML dependencies with compatible versions # ML dependencies with compatible versions
numpy==1.24.3 numpy==1.24.3
@ -21,12 +22,14 @@ scipy==1.10.1
scikit-learn==1.3.0 scikit-learn==1.3.0
# Audio processing and ML models # Audio processing and ML models
# Pin speechbrain for stability with pyannote.audio
speechbrain==1.0.0
pyannote.audio==3.1.1 pyannote.audio==3.1.1
pytorch-lightning==2.0.6 pytorch-lightning==2.1.0
# Other dependencies # Other dependencies
iso639>=0.1.4 iso639>=0.1.4
protobuf>=3.20.0,<4.0.0 protobuf>=3.20.0,<5.0.0
matplotlib>=3.5.0 matplotlib>=3.5.0
soundfile>=0.10.3 soundfile>=0.10.3
ffmpeg-python>=0.2.0 ffmpeg-python>=0.2.0