abdeladim-s / subsai

🎞️ Subtitles generation tool (Web-UI + CLI + Python package) powered by OpenAI's Whisper and its variants 🎞️
https://abdeladim-s.github.io/subsai/
GNU General Public License v3.0
1.31k stars 107 forks source link

WhisperX with diarization not working #114

Open caleidoscopio opened 9 months ago

caleidoscopio commented 9 months ago

I am unable to transcribe using WhisperX with diarization on Windows 10.

I get the following error message:

AttributeError: 'NoneType' object has no attribute 'to' Traceback: File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 565, in _run_script exec(code, module.dict) File "C:\Users\username\AppData\Local\Programs\Python\Python310\Lib\site-packages\subsai\webui.py", line 555, in run() File "C:\Users\username\AppData\Local\Programs\Python\Python310\Lib\site-packages\subsai\webui.py", line 548, in run webui() File "C:\Users\username\AppData\Local\Programs\Python\Python310\Lib\site-packages\subsai\webui.py", line 318, in webui subs = _transcribe(file_path, stt_model_name, model_config) File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 194, in wrapper return cached_func(*args, *kwargs) File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 223, in call return self._get_or_create_cached_value(args, kwargs) File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 248, in _get_or_create_cached_value return self._handle_cache_miss(cache, value_key, func_args, func_kwargs) File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 302, in _handle_cache_miss computed_value = self._info.func(func_args, **func_kwargs) File "C:\Users\username\AppData\Local\Programs\Python\Python310\Lib\site-packages\subsai\webui.py", line 190, in _transcribe subs = subs_ai.transcribe(media_file=file_path, model=model) File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\subsai\main.py", line 115, in transcribe return stt_model.transcribe(media_file) File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\subsai\models\whisperX_model.py", line 138, in transcribe diarize_model = whisperx.DiarizationPipeline(use_auth_token=self.HF_TOKEN, device=self.device) File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\whisperx\diarize.py", line 19, in init self.model = Pipeline.from_pretrained(model_name, use_auth_token=use_auth_token).to(device)

abdeladim-s commented 9 months ago

I think it's the same issue as in 70. Please try what I have suggested there