pub struct State { /* private fields */ }Implementations§
Source§impl State
impl State
pub fn new( model: LmModel, max_step_idx: usize, audio_lp: LogitsProcessor, text_lp: LogitsProcessor, pad_mult: Option<f32>, repetition_penalty: Option<(usize, f32)>, cfg_alpha: Option<f64>, config: Config, ) -> Self
pub fn step_idx(&self) -> usize
pub fn config(&self) -> &Config
pub fn user_rating(&self) -> u32
pub fn set_user_rating(&mut self, grade: u32)
pub fn step_( &mut self, text_token: Option<u32>, input_audio_tokens: &[u32], force_text_token: Option<u32>, ca_src: Option<&CaSrc>, conditions: Option<&Condition>, ) -> Result<u32>
pub fn step_without_ca_src( &mut self, text_token: u32, input_audio_tokens: &[u32], force_text_token: Option<u32>, ) -> Result<u32>
pub fn step( &mut self, text_token: u32, input_audio_tokens: &[u32], force_text_token: Option<u32>, ca_src: Option<&CaSrc>, ) -> Result<u32>
Sourcepub fn audio_tokens(&self, include_all: bool) -> &[Vec<u32>]
pub fn audio_tokens(&self, include_all: bool) -> &[Vec<u32>]
If include_all is set, all the time steps are returned. Otherwise only the timesteps that have been generated are handled.
pub fn text_tokens(&self, include_all: bool) -> &[u32]
pub fn last_audio_tokens(&self) -> Option<Vec<u32>>
Auto Trait Implementations§
impl Freeze for State
impl !RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl !UnwindSafe for State
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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