#[repr(C)]pub struct WhisperOptions {Show 15 fields
pub beam_size: usize,
pub patience: f32,
pub length_penalty: f32,
pub repetition_penalty: f32,
pub no_repeat_ngram_size: usize,
pub max_length: usize,
pub sampling_topk: usize,
pub sampling_temperature: f32,
pub num_hypotheses: usize,
pub return_scores: bool,
pub return_logits_vocab: bool,
pub return_no_speech_prob: bool,
pub max_initial_timestamp_index: usize,
pub suppress_blank: bool,
pub suppress_tokens: Vec<i32>,
}whisper only.Expand description
Options for whisper generation.
§Examples
Example of creating a default WhisperOptions:
use ct2rs::sys::WhisperOptions;
let options = WhisperOptions::default();Fields§
§beam_size: usizeBeam size to use for beam search (set 1 to run greedy search). (default: 5)
patience: f32Beam search patience factor, as described in https://arxiv.org/abs/2204.05424. The decoding will continue until beam_size*patience hypotheses are finished. (default: 1.0)
length_penalty: f32Exponential penalty applied to the length during beam search. (default: 1.0)
repetition_penalty: f32Penalty applied to the score of previously generated tokens, as described in https://arxiv.org/abs/1909.05858 (set > 1 to penalize). (default: 1.0)
no_repeat_ngram_size: usizePrevent repetitions of ngrams with this size (set 0 to disable). (default: 0)
max_length: usizeMaximum generation length. (default: 448)
sampling_topk: usizeRandomly sample from the top K candidates (set 0 to sample from the full distribution). (default: 1)
sampling_temperature: f32High temperatures increase randomness. (default: 1.0)
num_hypotheses: usizeNumber of hypotheses to include in the result. (default: 1)
return_scores: boolInclude scores in the result. (default: false)
return_logits_vocab: boolInclude log probs of each token in the result. (default: false)
return_no_speech_prob: boolInclude the probability of the no speech token in the result. (default: false)
max_initial_timestamp_index: usizeMaximum index of the first predicted timestamp. (default: 50)
suppress_blank: boolSuppress blank outputs at the beginning of the sampling. (default: true)
suppress_tokens: Vec<i32>List of token IDs to suppress.
-1 will suppress a default set of symbols as defined in the model config.json file.
(default: [-1])
Trait Implementations§
Source§impl Clone for WhisperOptions
impl Clone for WhisperOptions
Source§impl Debug for WhisperOptions
impl Debug for WhisperOptions
Source§impl Default for WhisperOptions
impl Default for WhisperOptions
Source§impl ExternType for WhisperOptions
impl ExternType for WhisperOptions
Auto Trait Implementations§
impl Freeze for WhisperOptions
impl RefUnwindSafe for WhisperOptions
impl Send for WhisperOptions
impl Sync for WhisperOptions
impl Unpin for WhisperOptions
impl UnsafeUnpin for WhisperOptions
impl UnwindSafe for WhisperOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().