pub struct DecodingConfig {
pub beam_size: usize,
pub temperatures: Vec<f32>,
pub length_penalty: f32,
pub no_speech_threshold: f32,
pub max_length: usize,
pub language: String,
pub task: Task,
pub compression_ratio_threshold: f32,
pub log_prob_threshold: f32,
}Expand description
Configuration for beam search decoding
Fields§
§beam_size: usizeBeam size for beam search (1 = greedy, 5 = default, 10+ = very accurate)
temperatures: Vec<f32>Temperature fallback sequence (tried in order; retry at next temp if quality fails)
length_penalty: f32Length penalty to prevent repeating short sequences (0.0 = no penalty)
no_speech_threshold: f32Threshold for no-speech detection based on cross-attention (0.0 to 1.0)
max_length: usizeMaximum tokens to generate
language: StringLanguage token (e.g., “en” for English; “auto” for first-token detection)
task: TaskDecode task: Transcribe (output in language) or Translate (X → English only).
compression_ratio_threshold: f32Gzip compression ratio threshold — ratio above this signals a hallucination loop (default 2.4)
log_prob_threshold: f32Average log-probability threshold — below this signals low-confidence output (default -1.0)
Implementations§
Source§impl DecodingConfig
impl DecodingConfig
Sourcepub fn with_beam_size(self, beam_size: usize) -> Self
pub fn with_beam_size(self, beam_size: usize) -> Self
Set beam size
Sourcepub fn with_temperature(self, temperature: f32) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
Override temperatures with a single value (disables fallback sequence)
Sourcepub fn with_length_penalty(self, penalty: f32) -> Self
pub fn with_length_penalty(self, penalty: f32) -> Self
Set length penalty
Sourcepub fn with_no_speech_threshold(self, threshold: f32) -> Self
pub fn with_no_speech_threshold(self, threshold: f32) -> Self
Set no-speech threshold
Sourcepub fn with_language(self, language: String) -> Self
pub fn with_language(self, language: String) -> Self
Set language
Trait Implementations§
Source§impl Clone for DecodingConfig
impl Clone for DecodingConfig
Source§fn clone(&self) -> DecodingConfig
fn clone(&self) -> DecodingConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for DecodingConfig
impl Debug for DecodingConfig
Auto Trait Implementations§
impl Freeze for DecodingConfig
impl RefUnwindSafe for DecodingConfig
impl Send for DecodingConfig
impl Sync for DecodingConfig
impl Unpin for DecodingConfig
impl UnsafeUnpin for DecodingConfig
impl UnwindSafe for DecodingConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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 more