-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from_pretrained load local model #126
Comments
same sa i |
Seeing the same. At a glance looks like the problem is this piece of code here: if model_name not in utils.MODELS_URL and not _os.path.isfile(model_name):
raise RuntimeError(
f"'{model_name}' is not a valid preconverted model or a file path. \
Choose one of {list(utils.MODELS_URL)}"
) The second part of this conditional appears to be failing. It's odd because I tried using the same absolute path with Not a huge issue anyway as you can just download the model with the predefined ones in OS details in case related: EDIT: Cache WorkaroundIn the meantime, you can just populate the cache yourself with your own model. This library looks in one of two directories for the models based on the existence of the # move your model into the cache
cp whisper.cpp/models/ggml-base.bin ~/.local/share/whispercpp # OR $XDG_DATA_HOME/whispercpp from whispercpp import Whisper
# use the local dir with your pretrained whisper model
whisper = Whisper.from_pretrained("base") |
if anyone still has this issue, it should be because the version on pypi is older than what's on the repo (I noticed the error message is different!) https://pypi.org/project/whispercpp/#files -> the source code only has
I fixed the error by installing from git
|
Describe the bug
code is
w = Whisper.from_pretrained('/Users/haowmazs/testdata/whisper.cpp-master/models/ggml-medium.bin')
throw exception
RuntimeError: '/Users/haowmazs/testdata/whisper.cpp-master/models/ggml-medium.bin' is not a valid preconverted model. Choose one of ['tiny.en', 'tiny', 'base.en', 'base', 'small.en', 'small', 'medium.en', 'medium', 'large-v1', 'large']
To reproduce
No response
Expected behavior
No response
Environment
Python 3.9.7
whispercpp 0.017
The text was updated successfully, but these errors were encountered: