-
Notifications
You must be signed in to change notification settings - Fork 4
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
add JNI library #54
base: main
Are you sure you want to change the base?
add JNI library #54
Conversation
Awesome work, thank you for your PR! Review is in progress, at a glance it looks very nice! |
As a quick task, can you rebase this change to top-of-tree on main branch and then run I believe some of the changes here for android may be incompatible with the linux target. |
WhisperKit/src/Core/tflite_msg.hpp
Outdated
@@ -7,21 +7,12 @@ | |||
#include <thread> | |||
#include <condition_variable> | |||
#include <mutex> | |||
|
|||
#ifdef ANDROID_JNI |
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.
Let's revert this, headers from android NDK should not be used for linux target
f00ea54
to
eeb3d0a
Compare
Hi @bpkeene! |
I have made sure the compatibility with Linux is kept as it was before. Regarding the android app, I will add that code later this week, today I managed to run the model with the QNN delegate for the first time, so great news! There are still some issues with the android app but I'm hoping we will manage to solve them with some collaboration :) Best regards! |
jni/NativeWhisperKit.cpp
Outdated
config.concurrentWorkerCount = concurrentWorkers; | ||
config.audioPath = audioPath; | ||
|
||
runner = new WhisperKitRunner(config); |
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.
could we use a unique_ptr? Looking to keep C-style memory management in the C API only (WhisperKit.h, WhisperKit.cpp). Otherwise removing any c-style allocations elsewhere, including internal files
Hi @bpkeene! I have added a commit having the WhisperKitConfig as a reference. This allows changes in the config after the runner object was created to take effect, which wasn't possible before. I pushed the app into one of the branches in my fork. I didn't do a PR yet, maybe it's better to merge the changes separately since it's a lot of code? Thanks for your input, |
Awesome work, thank you for making that change! I'll pull this locally and run through some quick tests, otherwise it LGTM! Really appreciate your contribution :) Excellent work!
Yes, happy to review this separately |
I updated this PR to mention only the JNI lib and opened a separate PR for the android app |
Awesome work- thank you for your contribution and patience :) |
Merge Request: JNI Library for Android Integration
Overview
This merge request introduces a JNI library that enables WhisperKit’s CLI to integrate with Android environments.
Key Contributions
1. JNI Library for Android Integration
2. Deployment and Testing Scripts
run_on_android.sh
:A new script simplifies running the CLI on an Android device via the ADB shell.
adb-push.sh
Updates:The script has been updated to also push:
The build script now accepts an additional
jni
flag, which was added due to the need to embed the SDL3 library into the.so
file. This was necessary to resolve issues with loading shared libraries in the JNI environment.Alignment with Project Goals
This merge request provides the essential JNI infrastructure needed for WhisperKit’s Android integration.
The new scripts and build enhancements streamline the workflow for testing and deploying WhisperKit’s JNI library on Android devices.