whisperX icon indicating copy to clipboard operation
whisperX copied to clipboard

`numpy==2.0.0` breaks model loading

Open YoungPhlo opened this issue 8 months ago • 5 comments

Command: whisperx "audio/test.mp3" --model "large-v2" --language "en"

Error:

Traceback (most recent call last):
  File "~/transcription/whisperX/venv/bin/whisperx", line 5, in <module>
    from whisperx.transcribe import cli
  File "~/transcription/whisperX/venv/lib/python3.10/site-packages/whisperx/__init__.py", line 1, in <module>
    from .transcribe import load_model
  File "~/transcription/whisperX/venv/lib/python3.10/site-packages/whisperx/transcribe.py", line 10, in <module>
    from .asr import load_model
  File "~/transcription/whisperX/venv/lib/python3.10/site-packages/whisperx/asr.py", line 13, in <module>
    from .vad import load_vad_model, merge_chunks
  File "~/transcription/whisperX/venv/lib/python3.10/site-packages/whisperx/vad.py", line 9, in <module>
    from pyannote.audio import Model
  File "~/transcription/whisperX/venv/lib/python3.10/site-packages/pyannote/audio/__init__.py", line 29, in <module>
    from .core.inference import Inference
  File "~/transcription/whisperX/venv/lib/python3.10/site-packages/pyannote/audio/core/inference.py", line 49, in <module>
    class Inference(BaseInference):
  File "~/transcription/whisperX/venv/lib/python3.10/site-packages/pyannote/audio/core/inference.py", line 533, in Inference
    missing: float = np.NaN,
  File "~/transcription/whisperX/venv/lib/python3.10/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.NaN` was removed in the NumPy 2.0 release. Use `np.nan` instead.. Did you mean: 'nan'?

ran pip install numpy==1.26.4

Collecting numpy==1.26.4
  Using cached numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl.metadata (61 kB)
Using cached numpy-1.26.4-cp310-cp310-macosx_11_0_arm64.whl (14.0 MB)
Installing collected packages: numpy
  Attempting uninstall: numpy
    Found existing installation: numpy 2.0.0
    Uninstalling numpy-2.0.0:
      Successfully uninstalled numpy-2.0.0
Successfully installed numpy-1.26.4

and it loaded the model on the next run.

Maybe it's just me, here are my specs:

- Operating System
ProductName:		macOS
ProductVersion:		14.1
BuildVersion:		23B2073
Kernel:			23.1.0

- Environment
zsh:		5.9 (x86_64-apple-darwin23.0)
Homebrew:	4.3.5
Python:		3.10.14

YoungPhlo avatar Jun 24 '24 09:06 YoungPhlo