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.15k stars 96 forks source link

TypeError at startup (MacOS) TypeError: issubclass() arg 1 must be a class #108

Closed pestikoko11 closed 5 months ago

pestikoko11 commented 5 months ago

Hi guys, I'm getting this error when I'm trying to start the webUI. I installed all of the requirements and should encounter no issues with that. The error:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/bin/subsai", line 5, in from subsai.cli import main File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/subsai/init.py", line 1, in from subsai.main import SubsAI, Tools File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/subsai/main.py", line 28, in from subsai.configs import AVAILABLE_MODELS File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/subsai/configs.py", line 12, in from subsai.models.whisperX_model import WhisperXModel File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/subsai/models/whisperX_model.py", line 16, in import whisperx File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/whisperx/init.py", line 1, in from .transcribe import load_model File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/whisperx/transcribe.py", line 10, in from .asr import load_model File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/whisperx/asr.py", line 13, in from .vad import load_vad_model, merge_chunks File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/whisperx/vad.py", line 9, in from pyannote.audio import Model File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyannote/audio/init.py", line 29, in from .core.inference import Inference File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyannote/audio/core/inference.py", line 37, in from pyannote.audio.core.model import Model, Specifications File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyannote/audio/core/model.py", line 47, in from pyannote.audio.core.task import ( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyannote/audio/core/task.py", line 38, in from pyannote.database import Protocol File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyannote/database/init.py", line 36, in from .registry import registry, LoadingMode File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyannote/database/registry.py", line 38, in from .custom import create_protocol, get_init File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyannote/database/custom.py", line 66, in from .loader import load_lst, load_trial File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pyannote/database/loader.py", line 44, in from spacy.tokens import Token File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/spacy/init.py", line 14, in from . import pipeline # noqa: F401 File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/spacy/pipeline/init.py", line 1, in from .attributeruler import AttributeRuler File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/spacy/pipeline/attributeruler.py", line 6, in from .pipe import Pipe File "spacy/pipeline/pipe.pyx", line 1, in init spacy.pipeline.pipe File "spacy/vocab.pyx", line 1, in init spacy.vocab File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/spacy/tokens/init.py", line 1, in from .doc import Doc File "spacy/tokens/doc.pyx", line 36, in init spacy.tokens.doc File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/spacy/schemas.py", line 250, in class TokenPattern(BaseModel): File "pydantic/main.py", line 198, in pydantic.main.ModelMetaclass.new File "pydantic/fields.py", line 506, in pydantic.fields.ModelField.infer File "pydantic/fields.py", line 436, in pydantic.fields.ModelField.init File "pydantic/fields.py", line 552, in pydantic.fields.ModelField.prepare File "pydantic/fields.py", line 661, in pydantic.fields.ModelField._type_analysis File "pydantic/fields.py", line 668, in pydantic.fields.ModelField._type_analysis File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/typing.py", line 1134, in subclasscheck return issubclass(cls, self.origin) TypeError: issubclass() arg 1 must be a class

Can anyone help me with this issue? Thanks a lot!

abdeladim-s commented 5 months ago

Hi @pestikoko11,

Seems there is something wrong with your Python installation. Can you try to install the project in a separate virtual environment ?

pestikoko11 commented 5 months ago

Hi @pestikoko11,

Seems there is something wrong with your Python installation. Can you try to install the project in a separate virtual environment ?

I am currently using python 3.10.0. Should I use another version for it? Seperate virtual environment as in a seperate folder or a different computer or a different python version? THanks a lot for your help.

abdeladim-s commented 5 months ago

A virtual env in Python is like an isolated lightweight Python environment separated from the system wide Python installation. You can create one by running this command:

python -m venv /path/to/new/virtual/environment  # path to an an empty folder 

Make sure that the env is activated, and then install subsai on this env by following the same steps in the installation section.

Let me know if you still have any difficulties.

pestikoko11 commented 5 months ago

Thanks a lot for your help! That worked for me!