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
addon: implement node addon call whisper through cpp #443
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great addition!
Do you think you can add a CI workflow to .build/workflows for building the addon and maybe running it using one of the "test" models available in the repo?
It would be really helpful, because the examples are growing and it becomes hard to maintain everything manually. Having an automated CI would make things easier.
As you said, CI is necessary. I will try to complete the corresponding CI in a new PR. |
I have completed CI in my own repo. After this pr is merged, I will open a new pr to merge CI with final path configuration. |
@chenqianhe great addition to this library! While testing I run into the problem that after building the actual node addon it hardcoded the path to the dylib file for some reason. Could you please suggest any idea on how to solve it? |
@dkryaklin I guess this may not be caused by my use of cmake-js compilation, because this has not happened before. This time I wrote a target cmakekist under the whole project, so maybe I need to check it overall. |
@dkryaklin I checked it. dylib file path is appointed by @rpath.
The @rpath in the compiled result is specified to th project Release path by default
Generally, when using this dylib in a new project, you need to configure Runpath Search Paths. Or use But I'm not sure whether we can optimize this thing by configuring the compilation configuration. I'm not particularly familiar with these on the mac. Maybe we need more professional people to help us solve this problem. |
@chenqianhe thanks! I did some research and was able to solve my problem by changing |
* addon: implement node addon call whisper through cpp * addon: modify the license to MIT * addon: remove iostream * addon: rename dir * addon: fix typo * addon: configure cmake to build when cmake-js is used
@dkryaklin By chance, what did you have to change to fix the path? I'm having the same issue right now. |
* addon: implement node addon call whisper through cpp * addon: modify the license to MIT * addon: remove iostream * addon: rename dir * addon: fix typo * addon: configure cmake to build when cmake-js is used
* addon: implement node addon call whisper through cpp * addon: modify the license to MIT * addon: remove iostream * addon: rename dir * addon: fix typo * addon: configure cmake to build when cmake-js is used
* addon: implement node addon call whisper through cpp * addon: modify the license to MIT * addon: remove iostream * addon: rename dir * addon: fix typo * addon: configure cmake to build when cmake-js is used
* addon: implement node addon call whisper through cpp * addon: modify the license to MIT * addon: remove iostream * addon: rename dir * addon: fix typo * addon: configure cmake to build when cmake-js is used
I tried to call Whisper in the node environment through addon. I hope I can contribute it to examples for reference.
The speed difference between calling in node environment and directly using cpp for reasoning is very small.
cpp(./main -m ggml-large.bin -l zh -f samples_jfk.wav):
node(node index.js --language=zh --model=../../ggml-large.bin --fname_inp=../../samples_jfk.wav):