]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/blob
5377b4ebb94a8b31a13df14b2af2f8dbd14f191a
[pkg/ggml/sources/whisper.cpp] /
1 package io.github.ggerganov.whispercpp.callbacks;
2
3 import com.sun.jna.Pointer;
4 import io.github.ggerganov.whispercpp.WhisperContext;
5 import io.github.ggerganov.whispercpp.model.WhisperState;
6 import io.github.ggerganov.whispercpp.model.WhisperTokenData;
7
8 import javax.security.auth.callback.Callback;
9
10 /**
11 * Callback to filter logits.
12 * Can be used to modify the logits before sampling.
13 * If not null, called after applying temperature to logits.
14 */
15 public interface WhisperLogitsFilterCallback extends Callback {
16
17 /**
18 * Callback method to filter logits.
19 *
20 * @param ctx The whisper context.
21 * @param state The whisper state.
22 * @param tokens The array of whisper_token_data.
23 * @param n_tokens The number of tokens.
24 * @param logits The array of logits.
25 * @param user_data User data.
26 */
27 void callback(WhisperContext ctx, WhisperState state, WhisperTokenData[] tokens, int n_tokens, float[] logits, Pointer user_data);
28 }