mirror of
https://github.com/ggerganov/whisper.cpp.git
synced 2025-04-10 18:48:21 +02:00
updated README for java
This commit is contained in:
parent
ce6f747064
commit
3f7436e8a0
@ -14,13 +14,10 @@ import io.github.ggerganov.whispercpp.WhisperCpp;
|
|||||||
public class Example {
|
public class Example {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
String modelpath;
|
|
||||||
WhisperCpp whisper = new WhisperCpp();
|
WhisperCpp whisper = new WhisperCpp();
|
||||||
// By default, models are loaded from ~/.cache/whisper/ and are usually named "ggml-${name}.bin"
|
// By default, models are loaded from ~/.cache/whisper/ and are usually named "ggml-${name}.bin"
|
||||||
// or you can provide the absolute path to the model file.
|
// or you can provide the absolute path to the model file.
|
||||||
whisper.initContext("base.en");
|
long context = whisper.initContext("base.en");
|
||||||
|
|
||||||
long context = whisper.initContext(modelpath);
|
|
||||||
try {
|
try {
|
||||||
whisper.fullTranscribe(context, samples);
|
whisper.fullTranscribe(context, samples);
|
||||||
|
|
||||||
@ -47,6 +44,13 @@ cd whisper.cpp/bindings/java
|
|||||||
./gradlew build
|
./gradlew build
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You need to have the `whisper` library in your [JNA library path](https://java-native-access.github.io/jna/4.2.1/com/sun/jna/NativeLibrary.html). On Windows the dll is included in the jar and you can update it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
copy /y ..\..\build\bin\Release\whisper.dll build\generated\resources\main\win32-x86-64\whisper.dll
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
The license for the Go bindings is the same as the license for the rest of the whisper.cpp project, which is the MIT License. See the `LICENSE` file for more details.
|
The license for the Go bindings is the same as the license for the rest of the whisper.cpp project, which is the MIT License. See the `LICENSE` file for more details.
|
||||||
|
Loading…
Reference in New Issue
Block a user