-
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
_pywhispercpp module could not be found #34
Comments
Seems like Python cannot see the DLL module for some reason, even though the wheels were built successfully for Windows. |
I confirm this problem exists. Building from source results in the same error. |
@NBNGaming, |
I'm getting the same exact error message regarding the .dll file...I searched the "lib" directory after pip installing and there are no .dll files within that directory. Any idea why? I'm not an expert so forgive me, but am I supposed to build whisper.cpp first and then install pywhispercpp? ggerganov's repo? I'm unfamiliar with building but can learn, but need to know if I have to install whisper.cpp first please. Thanks! BTW, I don't know what GCC toolchain means... Windows 10 |
@BBC-Esq, I am not quite sure why this is happening on Windows! But, before going through this path, here are some suggestions:
|
I'm using Python 3.11. Not familiar with WSL...any other ideas? Have you actually tested it on Windows? |
Apart from the Github action which ran successfully, I didn't make any tests on Windows unfortunately, I only tested the project on Linux. |
Actually, it wasn't that hard to test and it gave me this error:
I did pip install and then the link to the wheel you gave me. Here is the directory structure that another script of mine culled...Everything from the "pywhispercpp" directory downwards:
I noticed that the .pyd file is one level up within the "site-packages" folder though. |
Correction in case you didn't see my edit to the above message...The .pyd file is a directory higher in "site-packages". |
@BBC-Esq, so it's there at least. Not sure why Windows cannot find it!! |
Sure, I'll put it in both at the same time. |
Same exact error as before. Might it be that you're importing "_pywhispercpp" with an underscore at the beginning instead of simply "pywhispercpp"? |
The script I'm using is very simple. I even modified it to add appending the system path but am still getting the same error...
|
No, the Can you try with os.add_dll_directory instead of |
You should use |
Same error as before and here's the modified script:
I also tried this script:
It gave me a slightly different error:
NOTE: It says "or one of its dependencies" |
Windows is weird to be honest! |
I asked jeeves and he told me to try "dependency walker" from Microsoft but it didn't work...https://www.dependencywalker.com/ Then I tried https://github.com/lucasg/Dependencies/releases/tag/v1.11.1 The "file" "open" dialog only lets you select .dll files so you'll have to drag and drop the .pyd file...Anyways, this is what it gave me: It seems that "whisper.dll" is missing? So basically, I need to install openai's whisper? |
Great idea @BBC-Esq, |
Fucking A...it worked. I put it in the "site-packages" folder, the "benchmark_whisper" folder, and the "pywhispercpp" folder and it worked...now it's just a matter of narrowing it down to which folder hierarchy it should be in. |
...correction, it didn't actually work. It resolved that error, but now I'm getting "failed to compute log mel spectrogram:"
|
Finally! so that's what was missing! I should find a way to include it with the wheel! |
I/we fixed it! Mind explaining to me what
|
...do tell me you've implemented the gpu acceleration like cuda, etc. in your repo? I don't see anything in the documentation about a cuda let alone any other gpu acceleration parameters... ;-) |
The |
Damn, was looking forward to benchmarking cuda whisper.cpp. Anyways, fun little adventure tonight. Have a good one man. I'll follow new releases for when you include the .dll and/or support GPU. How hard can it be, to support cuda, vulkan, openblas, etc. ;-) |
It shouldn't be so hard I assume, but it'll need time, this is the problem :) |
Hey, Vulkan support is here and CUDA! |
I just discovered this and plan to benchmark it finally - so excited! |
Please do make a issue to post the benchmarks! Also look into what I've been up to here: #49 (comment) |
@BBC-Esq, looking forward it! 👍 |
If you'll recall, previously I helped troubleshoot the missing .dll issue and you gave me a link: #34 (comment) Now that it has CUDA and Vulkan support can you help me get this up and running...here's where I'm stuck at.
I ran the same script that I used previously...remember, the whisper.dll file needed to be within the Anyways, it ran but only on CPU. Am I correct in assuming that I need something other than These are under their Whisper.cpp 1.6.0 release... [EDIT] I also tried this instead but it still didn't work:
|
@BBC-Esq, of course.
If you follow the steps, it should be working basically, but let me know if you run into any issues. |
I followed the installation instructions and ran my script, but I received this error:
To clarify, after using
At that point is when I received the error... Here is the entire script I'm trying to run:
If it helps...I'm on Windows and use Not sure if it's an issue of putting the .dll and other files in the correct folder on a Windows system but...if this helps...beginning from the directory where my benchmarking script is located...you go into the |
So was the compilation successful at least ? Could you please check if there is no lib folder in that path |
THERE IS a "Lib" folder within that path...but my script is one directory higher at:
To clarify...here are the files I believe you're looking for:
Hold tight...I'm going to give you the entire command prompt prints from start to finish...won't "cls" inbetween. |
Thanks for the detailed answer. At least all the shared libraries seem to be there. But it's weird that it does not see the lib folder. os.add_dll_directory(os.path.join(os.path.dirname(__file__), 'lib')) Will look into the actual directory of the To avoid any path confusion, here are my suggestions:
Please follow these instructions again and let me know how it goes ? |
When you say "go to another folder"...what do you mean? Here is where my virtual environment will be created:
Here is the "new" folder I created:
After I build, the "new" folder has this folder:
Within this folder there is yet another folder named
Finally, within this folder are these files: Now where am I supposed to place my bench_whispercpp.py script? |
for example |
I created that folder and moved
|
Still cannot find it !! |
I also manually copied and pasted these files: ...to the Specifically, I pasted them to Then when i ran the script and it gave me a different error this time:
|
I'm trying to avoid installing it system-wide...Are you saying it's mandatory since I'm building it or something? This is what that path currently shows...Maybe from a prior installation, I don't know, but I never meant to install |
No, you don't need any manual copy if the wheel was successfully installed and the lib folder is there. |
No, No need to install it system wide, an activated virtual env is better! |
How about a screenshare, if anything, just for the sake of saving time? Discord? |
Yeah, that would save us a lot of time, but I am not home at the moment :( |
BTW, one more suggestion, can you build and share the wheel Inside the cloned directory, run python -m build --wheel you'll find the generated wheel inside the dist directory. |
What's your Discord name? Mine is But I saw your message and will try this last thing tonight. ;-) |
not sure when I'll come back to be honest, I will try to contact you. |
You didn't tell me I had to pip install "build". Luckily Claude saved me. ;-) Seems to have successfully built. removing build\bdist.win-amd64\wheel The discord wouldn't be tonight...just whenever, you have my info. Will try this wheel and let you know if that puts it to rest. |
I created the virtual environment and activated it...then simply pip install the wheel within the virtual environment. It successfully created this in my However, when I ran my script it only used CPU. Here's the script again for easy reference:
Hit me up on Discord when you want. Thanks. |
Finally worked 😮 Windows is just weird! did you set the flag before building the wheel ? GGML_CUDA=1 I think this one will work. Anyways, here is my discord |
When you have time for a quick Discord screenshare let's try it. I'm in Eastern timezone (u.s.) just FYI. |
I put it in "site-packages" and It works |
Just did a standard
PyPi
download in my venv as perpip install pywhispercpp
A standard script with:
Is failing with error:
For reference,
FFMpeg
is installed:The text was updated successfully, but these errors were encountered: