public class WhisperFullParams
extends com.sun.jna.Structure
| 限定符和类型 | 字段和说明 |
|---|---|
int |
audio_ctx
Overwrite the audio context size (0 = use default).
|
BeamSearchParams |
beam_search
Beam search decoding parameters.
|
CBool |
detect_language
Flag to indicate whether to detect language automatically.
|
int |
duration_ms
Audio duration to process in milliseconds.
|
com.sun.jna.Pointer |
encoder_begin_callback
Callback each time before the encoder starts.
|
com.sun.jna.Pointer |
encoder_begin_callback_user_data
User data for the encoder_begin_callback.
|
float |
entropy_thold
Entropy threshold (similar to OpenAI's "compression_ratio_threshold").
|
GreedyParams |
greedy
Greedy decoding parameters.
|
String |
initial_prompt
Tokens to provide to the whisper decoder as an initial prompt.
|
String |
language
Language for auto-detection.
|
float |
length_penalty
Length penalty.
|
com.sun.jna.Pointer |
logits_filter_callback
Callback by each decoder to filter obtained logits.
|
com.sun.jna.Pointer |
logits_filter_callback_user_data
User data for the logits_filter_callback.
|
float |
logprob_thold
Log probability threshold.
|
float |
max_initial_ts
Maximum initial timestamp.
|
int |
max_len
Maximum segment length in characters.
|
int |
max_tokens
Maximum tokens per segment (0, default = no limit)
|
int |
n_max_text_ctx
Maximum tokens to use from past text as a prompt for the decoder.
|
int |
n_threads
Number of threads.
|
com.sun.jna.Pointer |
new_segment_callback
Callback for every newly generated text segment.
|
com.sun.jna.Pointer |
new_segment_callback_user_data
User data for the new_segment_callback.
|
CBool |
no_context
Flag to indicate whether to use past transcription (if any) as an initial prompt for the decoder.
|
float |
no_speech_thold
No speech threshold.
|
int |
offset_ms
Start offset in milliseconds.
|
CBool |
print_progress
Flag to print progress information.
|
CBool |
print_realtime
Flag to print results from within whisper.cpp (avoid it, use callback instead).
|
CBool |
print_special
Flag to print special tokens (e.g., <SOT>, <EOT>, <BEG>, etc.).
|
CBool |
print_timestamps
Flag to print timestamps for each text segment when printing realtime.
|
com.sun.jna.Pointer |
progress_callback
Callback on each progress update.
|
com.sun.jna.Pointer |
progress_callback_user_data
User data for the progress_callback.
|
int |
prompt_n_tokens
Number of prompt tokens.
|
com.sun.jna.Pointer |
prompt_tokens
Prompt tokens.
|
CBool |
single_segment
Flag to force single segment output (useful for streaming).
|
CBool |
speed_up
Flag to speed up the audio by 2x using Phase Vocoder.
|
CBool |
split_on_word
Flag to split on word rather than on token (when used with max_len).
|
int |
strategy
Sampling strategy for whisper_full() function.
|
CBool |
suppress_blank
Flag to suppress blank tokens.
|
CBool |
suppress_non_speech_tokens
Flag to suppress non-speech tokens.
|
CBool |
tdrz_enable
Enable tinydiarize (default = false)
|
float |
temperature
Initial decoding temperature.
|
float |
temperature_inc
Temperature increment.
|
float |
thold_pt
[EXPERIMENTAL] Timestamp token probability threshold (~0.01).
|
float |
thold_ptsum
[EXPERIMENTAL] Timestamp token sum probability threshold (~0.01).
|
CBool |
token_timestamps
[EXPERIMENTAL] Flag to enable token-level timestamps.
|
CBool |
translate
Translate flag.
|
| 构造器和说明 |
|---|
WhisperFullParams(com.sun.jna.Pointer p) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
detectLanguage(boolean enable)
Flag to indicate whether to detect language automatically.
|
void |
enableContext(boolean enable)
Flag to indicate whether to use past transcription (if any) as an initial prompt for the decoder.
|
protected List<String> |
getFieldOrder() |
void |
printProgress(boolean enable)
Flag to print progress information.
|
void |
printRealtime(boolean enable)
Flag to print results from within whisper.cpp (avoid it, use callback instead).
|
void |
printSpecial(boolean enable)
Flag to print special tokens (e.g., <SOT>, <EOT>, <BEG>, etc.).
|
void |
printTimestamps(boolean enable)
Flag to print timestamps for each text segment when printing realtime.
|
void |
setBeamSize(int beamSize) |
void |
setBeamSizeAndPatience(int beamSize,
float patience) |
void |
setBestOf(int bestOf) |
void |
setEncoderBeginCallbackeginCallbackCallback(WhisperEncoderBeginCallback callback) |
void |
setLogitsFilterCallback(WhisperLogitsFilterCallback callback) |
void |
setNewSegmentCallback(WhisperNewSegmentCallback callback) |
void |
setProgressCallback(WhisperProgressCallback callback) |
void |
setPromptTokens(int[] tokens) |
void |
singleSegment(boolean single)
Flag to force single segment output (useful for streaming).
|
void |
speedUp(boolean enable)
Flag to speed up the audio by 2x using Phase Vocoder.
|
void |
splitOnWord(boolean enable)
Flag to split on word rather than on token (when used with max_len).
|
void |
suppressBlanks(boolean enable) |
void |
suppressNonSpeechTokens(boolean enable)
Flag to suppress non-speech tokens.
|
void |
tdrzEnable(boolean enable)
Enable tinydiarize (default = false)
|
void |
tokenTimestamps(boolean enable)
[EXPERIMENTAL] Flag to enable token-level timestamps.
|
void |
transcribeMode()
The compliment of translateMode()
|
void |
translateMode()
The compliment of transcribeMode()
|
allocateMemory, allocateMemory, autoAllocate, autoRead, autoRead, autoWrite, autoWrite, cacheTypeInfo, calculateSize, clear, createFieldsOrder, createFieldsOrder, createFieldsOrder, createFieldsOrder, dataEquals, dataEquals, ensureAllocated, equals, fieldOffset, getAutoRead, getAutoWrite, getFieldList, getFields, getNativeAlignment, getNativeSize, getNativeSize, getPointer, getStringEncoding, getStructAlignment, hashCode, newInstance, newInstance, read, readField, readField, setAlignType, setAutoRead, setAutoSynch, setAutoWrite, setStringEncoding, size, sortFields, toArray, toArray, toString, toString, useMemory, useMemory, write, writeField, writeField, writeFieldpublic int strategy
public int n_threads
public int n_max_text_ctx
public int offset_ms
public int duration_ms
public CBool translate
public CBool no_context
public CBool single_segment
public CBool print_special
public CBool print_progress
public CBool print_realtime
public CBool print_timestamps
public CBool token_timestamps
public float thold_pt
public float thold_ptsum
public int max_len
public CBool split_on_word
public int max_tokens
public CBool speed_up
public int audio_ctx
public CBool tdrz_enable
public String initial_prompt
public com.sun.jna.Pointer prompt_tokens
public int prompt_n_tokens
public String language
public CBool detect_language
public CBool suppress_blank
public CBool suppress_non_speech_tokens
public float temperature
public float max_initial_ts
public float length_penalty
public float temperature_inc
public float entropy_thold
public float logprob_thold
public float no_speech_thold
public GreedyParams greedy
public BeamSearchParams beam_search
public com.sun.jna.Pointer new_segment_callback
public com.sun.jna.Pointer new_segment_callback_user_data
public com.sun.jna.Pointer progress_callback
public com.sun.jna.Pointer progress_callback_user_data
public com.sun.jna.Pointer encoder_begin_callback
public com.sun.jna.Pointer encoder_begin_callback_user_data
public com.sun.jna.Pointer logits_filter_callback
public com.sun.jna.Pointer logits_filter_callback_user_data
public void transcribeMode()
public void translateMode()
public void enableContext(boolean enable)
public void singleSegment(boolean single)
public void printSpecial(boolean enable)
public void printProgress(boolean enable)
public void printRealtime(boolean enable)
public void printTimestamps(boolean enable)
public void tokenTimestamps(boolean enable)
public void splitOnWord(boolean enable)
public void speedUp(boolean enable)
public void tdrzEnable(boolean enable)
public void setPromptTokens(int[] tokens)
public void detectLanguage(boolean enable)
public void suppressBlanks(boolean enable)
public void suppressNonSpeechTokens(boolean enable)
public void setBestOf(int bestOf)
public void setBeamSize(int beamSize)
public void setBeamSizeAndPatience(int beamSize,
float patience)
public void setNewSegmentCallback(WhisperNewSegmentCallback callback)
public void setProgressCallback(WhisperProgressCallback callback)
public void setEncoderBeginCallbackeginCallbackCallback(WhisperEncoderBeginCallback callback)
public void setLogitsFilterCallback(WhisperLogitsFilterCallback callback)
Copyright © 2023. All rights reserved.