-
Notifications
You must be signed in to change notification settings - Fork 26
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
Cannot find ggml-metal.metal
on Mac to run on metal
#59
Comments
@ltoniazzi, Seems similar to #35. But this shouldn't happen if you installed the package from pip!! |
@abdeladim-s Thank you, but I cannot locate whisper.cpp in my installation as in the PR solution.
But this is what I see in my pip installation of Where should I find the location of |
I'm actually having the same issue with sgml-metal, but my understanding is you must pre-generate the ggml-metal models using whisper.cpp's conversion tools. |
We should really fix this. The model should be loaded from the venv, not arbitrary locations on disk. |
Ok, a bit of digging, we can get the en-encoder.mlmodelc from here: https://huggingface.co/ggerganov/whisper.cpp/tree/main Renaming it to |
I think we have a regression! |
@ltoniazzi, @UsernamesLame, Could you please try the latest pre-built wheel from CI. I haven't pushed a new version yet to PyPI. Pick the right wheel version from the artifacts and install it on a fresh virtual environment. |
@abdeladim-s I tried installing both wheels for Mac on python311 but I get this error inporting the package: >>> from pywhispercpp.model import Model
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/user/Workspace/pre-screener/.venv_testpywish_2/lib/python3.11/site-packages/pywhispercpp/__init__.py", line 14, in <module>
ctypes.CDLL(os.path.join(os.path.dirname(__file__), 'lib', file))
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 376, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: dlopen(/Users/user/Workspace/pre-screener/.venv_testpywish_2/lib/python3.11/site-packages/pywhispercpp/lib/_pywhispercpp.cpython-38-darwin.so, 0x0006): Library not loaded: @rpath/libwhisper.1.dylib
Referenced from: <4499501D-7C43-3580-B7DB-D4F668C98970> /Users/user/Workspace/pre-screener/.venv_testpywish_2/lib/python3.11/site-packages/pywhispercpp/lib/_pywhispercpp.cpython-38-darwin.so
Reason: tried: '/Users/runner/work/pywhispercpp/pywhispercpp/build/lib.macosx-10.9-universal2-cpython-38/libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/pywhispercpp/pywhispercpp/build/lib.macosx-10.9-universal2-cpython-38/libwhisper.1.dylib' (no such file), '/Users/runner/work/pywhispercpp/pywhispercpp/build/lib.macosx-10.9-universal2-cpython-38/libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/pywhispercpp/pywhispercpp/build/lib.macosx-10.9-universal2-cpython-38/libwhisper.1.dylib' (no such file)
>>> find .venv_testpywish/lib/ -name "libwhisper*.dylib"
File "<stdin>", line 1
find .venv_testpywish/lib/ -name "libwhisper*.dylib"
^^^^^^^^^^^^^^^^^^^
SyntaxError: invalid syntax
>>> exit() Notes:
pip install ~/Downloads/artifact/pywhispercpp-1.2.0-cp311-cp311-macosx_11_0_universal2.whl
find .venv_testpywish/lib/ -name "libwhisper*.dylib"
.venv_testpywish/lib//python3.11/site-packages/libwhisper.dylib
.venv_testpywish/lib//python3.11/site-packages/libwhisper.1.dylib
.venv_testpywish/lib//python3.11/site-packages/libwhisper.1.6.2.dylib |
@ltoniazzi, could you please check if the lib folder |
@abdeladim-s It contains these three: >>> find .venv_testpywish_2/lib/ -name "libwhisper*.dylib"
.venv_testpywish_2/lib//python3.11/site-packages/libwhisper.dylib
.venv_testpywish_2/lib//python3.11/site-packages/libwhisper.1.dylib
.venv_testpywish_2/lib//python3.11/site-packages/libwhisper.1.6.2.dylib |
@ltoniazzi, |
There is only these >>> ls .venv_testpywish_2/lib/python3.11/site-packages/pywhispercpp/lib
_pywhispercpp.cpython-310-darwin.so
_pywhispercpp.cpython-311-darwin.so
_pywhispercpp.cpython-38-darwin.so
_pywhispercpp.cpython-39-darwin.so After deleting them I get this error: >>> from pywhispercpp.model import Model
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/user/Workspace/pre-screener/.venv_testpywish_2/lib/python3.11/site-packages/pywhispercpp/model.py", line 14, in <module>
import _pywhispercpp as pw
ImportError: dlopen(/Users/useruser/Workspace/pre-screener/.venv_testpywish_2/lib/python3.11/site-packages/_pywhispercpp.cpython-311-darwin.so, 0x0002): Library not loaded: @rpath/libwhisper.1.dylib
Referenced from: <6D5C74BD-6BC9-3B3F-9FBB-A28147E30808> /Users/user/Workspace/pre-screener/.venv_testpywish_2/lib/python3.11/site-packages/_pywhispercpp.cpython-311-darwin.so
Reason: tried: '/Users/runner/work/pywhispercpp/pywhispercpp/build/lib.macosx-10.9-universal2-cpython-311/libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/pywhispercpp/pywhispercpp/build/lib.macosx-10.9-universal2-cpython-311/libwhisper.1.dylib' (no such file), '/Users/runner/work/pywhispercpp/pywhispercpp/build/lib.macosx-10.9-universal2-cpython-311/libwhisper.1.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/runner/work/pywhispercpp/pywhispercpp/build/lib.macosx-10.9-universal2-cpython-311/libwhisper.1.dylib' (no such file) |
@ltoniazzi, yeah there were no |
Issue
Installed with:
and running:
The code runs on cpu as I see the ggml logs:
Question
How to fix this? should I add manually the path to
ggml-metal.metal
as an env variable?Running on Mac/M2
The text was updated successfully, but these errors were encountered: