Package io.github.ggerganov.whispercpp
Class WhisperCpp
java.lang.Object
io.github.ggerganov.whispercpp.WhisperCpp
- All Implemented Interfaces:
AutoCloseable
Before calling most methods, you must call `initContext(modelPath)` to initialise the `ctx` Pointer.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbenchGgmlMulMat(int nthread) intbenchMemcpy(int nthread) voidclose()fullTranscribe(WhisperFullParams whisperParams, float[] audioData) Run the entire model: PCM -> log mel spectrogram -> encoder -> decoder -> text.getFullDefaultParams(WhisperSamplingStrategy strategy) Provides default params which can be used with `whisper_full()` etc.voidinitContext(String modelPath) modelDir()
-
Constructor Details
-
WhisperCpp
public WhisperCpp()
-
-
Method Details
-
modelDir
-
initContext
- Parameters:
modelPath- - absolute path, or just the name (eg: "base", "base-en" or "base.en")- Throws:
FileNotFoundException
-
getFullDefaultParams
Provides default params which can be used with `whisper_full()` etc. Because this function allocates memory for the params, the caller must call either: - call `whisper_free_params()` - `Native.free(Pointer.nativeValue(pointer));`- Parameters:
strategy- - GREEDY
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
fullTranscribe
Run the entire model: PCM -> log mel spectrogram -> encoder -> decoder -> text. Not thread safe for same context Uses the specified decoding strategy to obtain the text.- Throws:
IOException
-
getSystemInfo
-
benchMemcpy
public int benchMemcpy(int nthread) -
benchGgmlMulMat
public int benchGgmlMulMat(int nthread)
-