Skip to content

Commit

Permalink
Allow init OpenVINO encoder (#14)
Browse files Browse the repository at this point in the history
Signed-off-by: Miguel Álvarez <miguelwork92@gmail.com>
  • Loading branch information
GiviMAD authored Nov 12, 2023
1 parent 86943e6 commit 7f18ba6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<artifactId>whisper-jni</artifactId>
<name>whisper-jni</name>
<url>https://github.com/GiviMAD/whisper-jni</url>
<version>1.4.3-1</version>
<version>1.4.3-2</version>
<description>A JNI wrapper for [whisper.cpp](https://github.com/ggerganov/whisper.cpp), allows to transcribe speech to text in Java</description>

<licenses>
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/io/github/givimad/whisperjni/WhisperJNI.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.function.Consumer;

/**
* The {@link WhisperJNI} class allows to use whisper.cpp thought the JNI.
Expand Down Expand Up @@ -122,6 +121,17 @@ public WhisperState initState(WhisperContext context) {
return new WhisperState(this, initState(context.ref), context);
}

/**
* Initializes OpenVino encoder.
*
* @param context a {@link WhisperContext} instance.
* @param device the device name.
*/
public void initOpenVINO(WhisperContext context, String device) {
WhisperJNIPointer.assertAvailable(context);
initOpenVINOEncoder(context.ref, device);
}

/**
* Is multilingual.
*
Expand Down

0 comments on commit 7f18ba6

Please sign in to comment.