MahmoudAshraf97 / whisper-diarization

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

Installation issues with Windows #195

Closed sharik-siddiqi closed 3 months ago

sharik-siddiqi commented 4 months ago

I tried to follow the steps for my Windows PC but I'm facing the following issues:

(myenv) PS C:\Users\AI-Install\Documents\transcribe\whisper-diarization> pip install -r requirements.txt
Collecting git+https://github.com/m-bain/whisperX.git@78dcfaab51005aa703ee21375f81ed31bc248560 (from -r requirements.txt (line 3))
  Cloning https://github.com/m-bain/whisperX.git (to revision 78dcfaab51005aa703ee21375f81ed31bc248560) to c:\users\ai-install\appdata\local\temp\pip-req-build-mk1_9cj8
  Running command git clone --filter=blob:none --quiet https://github.com/m-bain/whisperX.git 'C:\Users\AI-Install\AppData\Local\Temp\pip-req-build-mk1_9cj8'
  Running command git rev-parse -q --verify 'sha^78dcfaab51005aa703ee21375f81ed31bc248560'
  Running command git fetch -q https://github.com/m-bain/whisperX.git 78dcfaab51005aa703ee21375f81ed31bc248560
  Running command git checkout -q 78dcfaab51005aa703ee21375f81ed31bc248560
  Resolved https://github.com/m-bain/whisperX.git to commit 78dcfaab51005aa703ee21375f81ed31bc248560
  Preparing metadata (setup.py) ... done
Collecting git+https://github.com/adefossez/demucs.git (from -r requirements.txt (line 4))
  Cloning https://github.com/adefossez/demucs.git to c:\users\ai-install\appdata\local\temp\pip-req-build-w4nuy8zl
  Running command git clone --filter=blob:none --quiet https://github.com/adefossez/demucs.git 'C:\Users\AI-Install\AppData\Local\Temp\pip-req-build-w4nuy8zl'
  Resolved https://github.com/adefossez/demucs.git to commit 8174c5d2c259dabc69acd842fc4ba5111539d507
  Preparing metadata (setup.py) ... done
Collecting git+https://github.com/oliverguhr/deepmultilingualpunctuation.git (from -r requirements.txt (line 5))
  Cloning https://github.com/oliverguhr/deepmultilingualpunctuation.git to c:\users\ai-install\appdata\local\temp\pip-req-build-ys23vvka
  Running command git clone --filter=blob:none --quiet https://github.com/oliverguhr/deepmultilingualpunctuation.git 'C:\Users\AI-Install\AppData\Local\Temp\pip-req-build-ys23vvka'
  Resolved https://github.com/oliverguhr/deepmultilingualpunctuation.git to commit 5a0dd7f4fd56687f59405aa8eba1144393d8b74b
  Preparing metadata (setup.py) ... done
Collecting git+https://github.com/MahmoudAshraf97/ctc-forced-aligner.git (from -r requirements.txt (line 6))
  Cloning https://github.com/MahmoudAshraf97/ctc-forced-aligner.git to c:\users\ai-install\appdata\local\temp\pip-req-build-ljh8a371
  Running command git clone --filter=blob:none --quiet https://github.com/MahmoudAshraf97/ctc-forced-aligner.git 'C:\Users\AI-Install\AppData\Local\Temp\pip-req-build-ljh8a371'
  Resolved https://github.com/MahmoudAshraf97/ctc-forced-aligner.git to commit 27a3f246cf9b7bbd5bf3d4da54a33f36606f75e7
  Running command git submodule update --init --recursive -q
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: wget in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from -r requirements.txt (line 1)) (3.2)
Collecting nemo_toolkit==1.23.0 (from nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2))
  Using cached nemo_toolkit-1.23.0-py3-none-any.whl.metadata (18 kB)
Requirement already satisfied: huggingface-hub in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (0.23.2)
Requirement already satisfied: numba in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (0.59.1)
Requirement already satisfied: numpy>=1.22 in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (1.23.5)
Requirement already satisfied: onnx>=1.7.0 in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (1.16.1)
Requirement already satisfied: python-dateutil in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (2.9.0.post0)
Requirement already satisfied: ruamel.yaml in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (0.18.6)
Requirement already satisfied: scikit-learn in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (1.5.0)
Requirement already satisfied: setuptools>=65.5.1 in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (69.5.1)
Requirement already satisfied: tensorboard in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (2.16.2)
Requirement already satisfied: text-unidecode in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (1.3)
Requirement already satisfied: torch in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (2.3.0)
Requirement already satisfied: tqdm>=4.41.0 in c:\users\ai-install\anaconda3\envs\myenv\lib\site-packages (from nemo_toolkit==1.23.0->nemo_toolkit[asr]==1.23.0->-r requirements.txt (line 2)) (4.66.4)
INFO: pip is looking at multiple versions of nemo-toolkit to determine which version is compatible with other requirements. This could take a while.
ERROR: Could not find a version that satisfies the requirement triton (from nemo-toolkit) (from versions: none)
ERROR: No matching distribution found for triton
eduardozf commented 3 months ago

The error message you received indicates that pip is unable to find a compatible version of the triton package required by nemo-toolkit. Try install triton manually.

# Upgrade pip
python --upgrade pip

# Download the appropriate Triton from https://github.com/openai/triton/releases
pip install [path_to_downloaded_file]

# Install NeMo toolkit with ASR (Automatic Speech Recognition) support
pip install nemo_toolkit[asr]
ViktorTrojan commented 3 months ago

I cant get it to work either. Seems like it tries to download cuda v12 for some reason and that for linux even though im on windows. maybe it doesnt even work for windows?

pip install C:\Users\Anix\Downloads\triton\python
Processing c:\users\anix\downloads\triton\python
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [32 lines of output]
      downloading and extracting https://anaconda.org/nvidia/cuda-nvcc/12.4.99/download/linux-AMD64/cuda-nvcc-12.4.99-0.tar.bz2 ...
      Traceback (most recent call last):
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
          main()
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\site-packages\pip\_vendor\pyproject_hooks\_in_process\_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
        File "C:\Users\Anix\AppData\Local\Temp\pip-build-env-keenrn03\overlay\Lib\site-packages\setuptools\build_meta.py", line 327, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=[])
        File "C:\Users\Anix\AppData\Local\Temp\pip-build-env-keenrn03\overlay\Lib\site-packages\setuptools\build_meta.py", line 297, in _get_build_requires
          self.run_setup()
        File "C:\Users\Anix\AppData\Local\Temp\pip-build-env-keenrn03\overlay\Lib\site-packages\setuptools\build_meta.py", line 497, in run_setup
          super().run_setup(setup_script=setup_script)
        File "C:\Users\Anix\AppData\Local\Temp\pip-build-env-keenrn03\overlay\Lib\site-packages\setuptools\build_meta.py", line 313, in run_setup
          exec(code, locals())
        File "<string>", line 439, in <module>
        File "<string>", line 268, in download_and_copy
        File "<string>", line 199, in open_url
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 216, in urlopen
          return opener.open(url, data, timeout)
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 525, in open
          response = meth(req, response)
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 634, in http_response
          response = self.parent.error(
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 563, in error
          return self._call_chain(*args)
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 496, in _call_chain
          result = func(*args)
        File "C:\Users\Anix\AppData\Local\Programs\Python\Python310\lib\urllib\request.py", line 643, in http_error_default
          raise HTTPError(req.full_url, code, msg, hdrs, fp)
      urllib.error.HTTPError: HTTP Error 404: Not Found
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
Yarharhar commented 3 months ago

I've got this working on windows. Writing the process down here for my future self's sake:

Using Anaconda powershell prompt (miniconda3)

  1. Create an environment for the project (conda create -n whisperD)
  2. Activate said environment (conda activate whisperD)
  3. conda install python==3.10
  4. pip install cython torch
  5. choco install ffmpeg
  6. Install triton manually (pip install https://huggingface.co/r4ziel/xformers_pre_built/resolve/main/triton-2.0.0-cp310-cp310-win_amd64.whl)
  7. pip install -r requirements.txt
  8. Go to your miniconda environment, find the python executable, and make a copy or simlink of it and name it python3
  9. manually install torchvision while making sure it doesn't mangle the torchaudio installation (pip install torchaudio torchvision)
  10. Install perl (conda install -c conda-forge perl)
  11. deactivate and reactivate the environment
  12. The diarize command should now work
MahmoudAshraf97 commented 3 months ago

should be fixed now without workarounds as triton is no longer required by NeMo