Vaibhavs10 / insanely-fast-whisper

Apache License 2.0
6.92k stars 505 forks source link

Incompatible with NumPy 2.0... #233

Open chadacious opened 2 weeks ago

chadacious commented 2 weeks ago

Attempting to run this after install I get:

File "/Users/chad/Library/Application Support/pipx/venvs/insanely-fast-whisper/lib/python3.12/site-packages/pyannote/audio/core/inference.py", line 529, in Inference
    missing: float = np.NaN,
                     ^^^^^^
  File "/Users/chad/Library/Application Support/pipx/venvs/insanely-fast-whisper/lib/python3.12/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'?

Still looking into if downgrading NumPy will resolve the issue.

Amandrs commented 1 week ago

Change line to

missing: float = np.nan,

and this will work

jacobpretorius commented 1 week ago

Change line to

missing: float = np.nan,

and this will work

Doing that gives the next error

C:\Users\USER\AppData\Local\Programs\Python\Python312\Lib\site-packages\torch\nested\_internal\nested_tensor.py:417: UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84.)

This is with the latest version of the package 0.0.15.

Downgrading numpy worked for me (keeping the original np.NaN as is)

pip uninstall numpy
pip install numpy==1.26.3
putssander commented 1 week ago

Using pipx, I successfully downgraded numpy with the following command from my notebook: !pipx inject insanely-fast-whisper numpy==1.26.4 --force