MahmoudAshraf97 / whisper-diarization

Automatic Speech Recognition with Speaker Diarization based on OpenAI Whisper
BSD 2-Clause "Simplified" License
2.44k stars 238 forks source link

Notebook isn't working #150

Closed NasonZ closed 4 months ago

NasonZ commented 6 months ago

I'm attempting to run the notebook but it fails when trying to run the imports.

import os
import wget
from omegaconf import OmegaConf
import json
import shutil
from faster_whisper import WhisperModel
import whisperx
import torch
from pydub import AudioSegment
from nemo.collections.asr.models.msdd_models import NeuralDiarizer
from deepmultilingualpunctuation import PunctuationModel
import re
import logging
import nltk
from whisperx.alignment import DEFAULT_ALIGN_MODELS_HF, DEFAULT_ALIGN_MODELS_TORCH
from whisperx.utils import LANGUAGES, TO_LANGUAGE_CODE

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
[<ipython-input-13-126e61cacd2c>](https://localhost:8080/#) in <cell line: 7>()
      5 import shutil
      6 from faster_whisper import WhisperModel
----> 7 import whisperx
      8 import torch
      9 from pydub import AudioSegment

11 frames
[/usr/local/lib/python3.10/dist-packages/numpy/__init__.py](https://localhost:8080/#) in __getattr__(attr)
    309             return val
    310 
--> 311         if attr in __future_scalars__:
    312             # And future warnings for those that will change, but also give
    313             # the AttributeError

AttributeError: module 'numpy' has no attribute '_no_nep50_warning'

I've tried installing and uninstalling numpy, any ideas on how to resolve this?

NasonZ commented 6 months ago

A work around for this is to install the dependencies via the given requirements.txt instead of using the code given in the notebook.

luxunator commented 6 months ago

@NasonZ I'm having same issues, can you paste what you edited in the notebook to get it working?

NasonZ commented 6 months ago

I uploaded the repo to colab as a zip file (cloning it would also work I guess), then ran.

!pip install cython

!sudo apt update && sudo apt install ffmpeg

!unzip /content/whisper-diarization-main.zip

!cd whisper-diarization-main/

%cd whisper-diarization-main/

!ls

!pip install -r requirements.txt

Managed to run the rest of the notebook without issue after this

Manamama commented 5 months ago

Has not helped. The original notebook could not import (download) a model.

After I added the lines, as per above, to the notebook :

...
!pip install numba==0.58.0
!pwd
!pip install cython
!git clone https://github.com/MahmoudAshraf97/whisper-diarization
#!sudo apt update && sudo apt install ffmpeg
%cd whisper-diarization/

!ls

!pip install -r requirements.txt

i get


[<ipython-input-4-126e61cacd2c>](https://localhost:8080/#) in <cell line: 6>()
      4 import json
      5 import shutil
----> 6 from faster_whisper import WhisperModel
      7 import whisperx
      8 import torch

9 frames
[/usr/local/lib/python3.10/dist-packages/torch/__init__.py](https://localhost:8080/#) in <module>
    227     if USE_GLOBAL_DEPS:
    228         _load_global_deps()
--> 229     from torch._C import *  # noqa: F403
    230 
    231 # Appease the type checker; ordinarily this binding is inserted by the
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 0: invalid start byte
MahmoudAshraf97 commented 4 months ago

Notebook updated and confirmed working on colab