Type error , tried everything nothing working
skillhacker-code opened this issue · 6 comments
File "C:\Program Files\Python310\lib\pathlib.py", line 583, in _parse_args
raise TypeError(
TypeError: argument should be a str object or an os.PathLike object returning str, not <class 'bytes'>
Running into this same issue.
Saving models to: /Users/djfs/.ggml-models Traceback (most recent call last): File "/Users/djfs/Desktop/work/company/whisper_tests/whisper-test.py", line 10, in <module> whisper = Whisper('medium') File "whispercpp.pyx", line 89, in whispercpp.Whisper.__init__ File "whispercpp.pyx", line 34, in whispercpp.download_model File "whispercpp.pyx", line 31, in whispercpp.model_exists File "/Users/djfs/.pyenv/versions/3.9.11/lib/python3.9/pathlib.py", line 972, in joinpath return self._make_child(args) File "/Users/djfs/.pyenv/versions/3.9.11/lib/python3.9/pathlib.py", line 737, in _make_child drv, root, parts = self._parse_args(args) File "/Users/djfs/.pyenv/versions/3.9.11/lib/python3.9/pathlib.py", line 696, in _parse_args raise TypeError( TypeError: argument should be a str object or an os.PathLike object returning str, not <class 'bytes'>
I tried it with 'medium', 'tiny' and blank inside the Whisper(), but all threw the same error.
same problem.
removing the .encode('utf-8')
in whispercpp.pyx should fix the type issue.
def __init__(self, model=DEFAULT_MODEL, pb=None):
model_fullname = f'ggml-{model}.bin'.encode('utf8')
where is that file?
Bump. pip show whispercpp
is of no use since the library only shows a .so dynamic library instead of the actual .pyx file.
I cloned the repo and made the fix then just used pip to install it with my changes or you can check the pull requests for all the changes i made.