-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Documentation: What are the main Java bindings? #2710
Comments
i also want to bind whisper cpp and java i got some error can you help in this |
I am not at my computer rn, I'll write what I did in a few hours
…On Mon, Jan 27, 2025, at 1:51 AM, pavan901 wrote:
i also want to bind whisper cpp and java i got some error can you help in this
—
Reply to this email directly, view it on GitHub <#2710 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BNBQPEBW2QUQG2NIMNVGI5T2MXQRRAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJVGA2DOMZZGU>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
thanks bro please let me know detailed step when you free |
Ok, I don't have the code rn, but I can get that in another day. I needed to transcribe audio from tye mix, so I thought I had 2 options:
- Rewrite the stream example in java.
This would probably be using the jni binding in the separate repo, as they have been updated more.
- (This is what i am doing) write and compile what I need in cpp, then run the binary using the Java Process api. I put the binary for the stream example and the base model in the resources folder, got the absolute path, then ran it. It works great, but I am struggling to read from `prosses.getInput()`, the output of the stream example. I will add more info in a bit, but I have a question on stackoverflow right now. It is titled something like "Java: read last line from InputStream" Do you have any ideas?
I hope this helps you, @pavan901
…On Tue, Jan 28, 2025, at 5:42 AM, pavan901 wrote:
thanks bro please let me know detailed step when you free
—
Reply to this email directly, view it on GitHub <#2710 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BNBQPEH5VWLUGENZJFHAMKD2M5UJRAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJYG43DGOJUGA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
*the microphone
…On Tue, Jan 28, 2025, at 7:29 AM, Elijah Crum wrote:
Ok, I don't have the code rn, but I can get that in another day. I needed to transcribe audio from tye mix, so I thought I had 2 options:
- Rewrite the stream example in java.
This would probably be using the jni binding in the separate repo, as they have been updated more.
- (This is what i am doing) write and compile what I need in cpp, then run the binary using the Java Process api. I put the binary for the stream example and the base model in the resources folder, got the absolute path, then ran it. It works great, but I am struggling to read from `prosses.getInput()`, the output of the stream example. I will add more info in a bit, but I have a question on stackoverflow right now. It is titled something like "Java: read last line from InputStream" DO you have any ideas?
I hope this helps you, @pavan901
On Tue, Jan 28, 2025, at 5:42 AM, pavan901 wrote:
>
>
> thanks bro please let me know detailed step when you free
>
>
>
> —
> Reply to this email directly, view it on GitHub <#2710 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/BNBQPEH5VWLUGENZJFHAMKD2M5UJRAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJYG43DGOJUGA>.
> You are receiving this because you authored the thread.Message ID: ***@***.***>
>
>
|
My aim is to implement STT functionality in My application using
Whisper.cpp, leveraging its Java bindings located in the binding/java
directory. However, the provided README and examples do not clearly outline
the necessary steps to set up and utilize these bindings.
…On Tue, Jan 28, 2025 at 7:03 PM crummyh ***@***.***> wrote:
*the microphone
On Tue, Jan 28, 2025, at 7:29 AM, Elijah Crum wrote:
> Ok, I don't have the code rn, but I can get that in another day. I
needed to transcribe audio from tye mix, so I thought I had 2 options:
>
> - Rewrite the stream example in java.
> This would probably be using the jni binding in the separate repo, as
they have been updated more.
>
> - (This is what i am doing) write and compile what I need in cpp, then
run the binary using the Java Process api. I put the binary for the stream
example and the base model in the resources folder, got the absolute path,
then ran it. It works great, but I am struggling to read from
`prosses.getInput()`, the output of the stream example. I will add more
info in a bit, but I have a question on stackoverflow right now. It is
titled something like "Java: read last line from InputStream" DO you have
any ideas?
>
> I hope this helps you, @pavan901
>
> On Tue, Jan 28, 2025, at 5:42 AM, pavan901 wrote:
>>
>>
>> thanks bro please let me know detailed step when you free
>>
>>
>>
>> —
>> Reply to this email directly, view it on GitHub <
#2710 (comment)>,
or unsubscribe <
https://github.com/notifications/unsubscribe-auth/BNBQPEH5VWLUGENZJFHAMKD2M5UJRAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJYG43DGOJUGA>.
>> You are receiving this because you authored the thread.Message ID:
***@***.***>
>>
>>
>
—
Reply to this email directly, view it on GitHub
<#2710 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNXWFLHDXMKJXJMXE5B3RA32M6BLPAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJZGAYTENRYHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
What do you mean by SST? The docs have almost nothing, your best chance is to go into WhisperCppJnaLibrary.java and look there, or how it was done in the getFullDefaultParams() function in WhisperCpp.java. If you have a C++ example, you could try to translate it line by line. Or you can do what do what I did and write it C++ and transport the data through an a pipeline |
To set up whisper-jni, I added this line to implementation 'io.github.givimad:whisper-jni:1.7.1'
|
GiviMAD/whisper-jni#23
see this pr i get same error like that is mentioned in whisper jni
…On Tue, Jan 28, 2025 at 10:44 PM crummyh ***@***.***> wrote:
To set up whisper-jni, I added this line to dependencies in build.gradle:
implementation 'io.github.givimad:whisper-jni:1.7.1'
WhisperJNI.java
<https://github.com/GiviMAD/whisper-jni/blob/main/src/main/java/io/github/givimad/whisperjni/WhisperJNI.java>
and io_github_givimad_whisperjni_WhisperJNI.h
<https://github.com/GiviMAD/whisper-jni/blob/main/src/main/native/io_github_givimad_whisperjni_WhisperJNI.h>
have some documentation, but not much.
—
Reply to this email directly, view it on GitHub
<#2710 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNXWFLFO4XE57UXGLUJVQZT2M63IHAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMJZGYYDGOJWHA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
You might be able to use the other bindings in whisper.cpp/binding/java, or you could do something with the Java Android example. I haven't looked at it yet, but you might be able to use whisper.cpp in a similar way even when you aren't on Android. |
I already go through the example i can run it after cloning but i cant
use whisper in new project because it need whisper.cpp path ther or the
soft link it make your app very much heavy
…On Wed, Jan 29, 2025 at 7:34 PM crummyh ***@***.***> wrote:
You might be able to use the other bindings in whisper.cpp/binding/java,
or you could do something with the Android example
<https://github.com/ggerganov/whisper.cpp/tree/master/examples/whisper.android>.
I haven't looked at it yet, but you might be able to use whisper.cpp in a
similar way even when you aren't on Android.
—
Reply to this email directly, view it on GitHub
<#2710 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNXWFLGIHGQXT5YV2DBPE632NDNWTAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRRG42DINJZGM>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
No matter what you do, you will need the whisper model and binary. The model is the main concern, and the whisper binary is much, much smaller. Right now I am looking at moonshine, which promises faster and more accurate transcription with resource-constrained devices. Right now the implementation is in Python, but you could be able to rewrite it in Java using Tersorflow Java. Right now moonshine only supports English, which might be an issue in production, but it is at least a start. Moonshine might work better if you are doing transcription on the client side, on the server side a larger model might work better. |
Note that this issue still stands, as it is not clear which Java Bindings are considered the "main" bindings. |
https://github.com/bytedeco/javacpp might be an option for an alternative to the Java Bindings or Whisper-JNI. For moonshine, |
i try and then tell you about this
…On Thu, Jan 30, 2025 at 10:37 PM crummyh ***@***.***> wrote:
https://github.com/bytedeco/javacpp might be an option for an alternative
to the Java Bindings or Whisper-JNI. For moonshine, onnxruntime
<https://central.sonatype.com/artifact/com.microsoft.onnxruntime/onnxruntime>
might be an option, but the current Python implementation uses
huggingface_hub.hf_hub_download() to load the module, which would likely
solve the size issues you talked about, but would have to be re-implemented
in Java.
—
Reply to this email directly, view it on GitHub
<#2710 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BNXWFLAC55P2JTDUZMHICDT2NJL4PAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRVGA3TOOBTGU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
and thanks for the help
…On Fri, Jan 31, 2025 at 12:51 PM Pavan Faldu ***@***.***> wrote:
i try and then tell you about this
On Thu, Jan 30, 2025 at 10:37 PM crummyh ***@***.***> wrote:
> https://github.com/bytedeco/javacpp might be an option for an
> alternative to the Java Bindings or Whisper-JNI. For moonshine,
> onnxruntime
> <https://central.sonatype.com/artifact/com.microsoft.onnxruntime/onnxruntime>
> might be an option, but the current Python implementation uses
> huggingface_hub.hf_hub_download() to load the module, which would likely
> solve the size issues you talked about, but would have to be re-implemented
> in Java.
>
> —
> Reply to this email directly, view it on GitHub
> <#2710 (comment)>,
> or unsubscribe
> <https://github.com/notifications/unsubscribe-auth/BNXWFLAC55P2JTDUZMHICDT2NJL4PAVCNFSM6AAAAABUVWNWLSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMMRVGA3TOOBTGU>
> .
> You are receiving this because you were mentioned.Message ID:
> ***@***.***>
>
|
In the main README, there is a "supported platforms" section with a link to the Java bindings. But further in the doc, in the Bindings section, there is a link to the Whisper-JNI repository. Are these bindings the same? If not, which is preferred?
Thanks!
The text was updated successfully, but these errors were encountered: