1 package io.github.ggerganov.whispercpp.callbacks;
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;
8 import javax.security.auth.callback.Callback;
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.
15 public interface WhisperLogitsFilterCallback extends Callback {
18 * Callback method to filter logits.
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.
27 void callback(WhisperContext ctx, WhisperState state, WhisperTokenData[] tokens, int n_tokens, float[] logits, Pointer user_data);