]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commit
bindings.java : enable copyLibs task [no ci] (#2949)
authorDaniel Bevenius <redacted>
Wed, 26 Mar 2025 14:01:28 +0000 (15:01 +0100)
committerGitHub <redacted>
Wed, 26 Mar 2025 14:01:28 +0000 (15:01 +0100)
commit0b43a02be809a063ff5ac3eaab5a7fcd54be0eb3
tree55605a89fec6e9612d2289e563fae6c8f7560917
parent2699e1485a9180cc666a937cf1b3c17da4168bf3
bindings.java : enable copyLibs task [no ci] (#2949)

* bindings.java : enable copyLibs task [no ci]

This commit adds a dependency on the copyLibs task to the sourcesJar and
jar tasks. This ensures that the libwhisper.so file is copied to the
correct location before the jar is built.

It also sets the executable bit on the gradlew file.

* bindings.java : add copyLibs dep for processResources [no ci]

This will otherwise cause builds to fail after doing an initial build.

* bindings.java : pass structs by value to native code

This commit refactors the code to pass the structs by value to the
native code. This is done by creating a ByValue class for each struct
and using it in the Java code.

The motivation for this change is that without this application crashes
due to what I believe was memory mis-alignement. When the structs were
passed to the native code they would be att different memory locations.
Passing by value overcomes this issue and considering that the structs
hold parementers (context and full params) it might be alright do to
this. These changes allow all the tests to pass.

* bindings.java : fix javadoc warnings [no ci]

* bindings.java : fix libwhisper.dylib path in build.gradle [no ci]

This commit fixes the copyLibwhisperDynlib task in the build.gradle file
to copy the correct libwhisper.dylib file from build/src.
12 files changed:
bindings/java/build.gradle
bindings/java/gradlew [changed mode: 0644->0755]
bindings/java/src/main/java/io/github/ggerganov/whispercpp/WhisperConstants.java [new file with mode: 0644]
bindings/java/src/main/java/io/github/ggerganov/whispercpp/WhisperContext.java
bindings/java/src/main/java/io/github/ggerganov/whispercpp/WhisperCpp.java
bindings/java/src/main/java/io/github/ggerganov/whispercpp/WhisperCppJnaLibrary.java
bindings/java/src/main/java/io/github/ggerganov/whispercpp/callbacks/GgmlAbortCallback.java [new file with mode: 0644]
bindings/java/src/main/java/io/github/ggerganov/whispercpp/params/WhisperAhead.java [new file with mode: 0644]
bindings/java/src/main/java/io/github/ggerganov/whispercpp/params/WhisperAheads.java [new file with mode: 0644]
bindings/java/src/main/java/io/github/ggerganov/whispercpp/params/WhisperContextParams.java
bindings/java/src/main/java/io/github/ggerganov/whispercpp/params/WhisperFullParams.java
bindings/java/src/test/java/io/github/ggerganov/whispercpp/WhisperCppTest.java