pub struct State { /* private fields */ }Implementations§
Source§impl State
impl State
pub fn new( model: LmModel, ca_src: Option<CaSrc>, max_step_idx: usize, audio_lp: LogitsProcessor, text_lp: LogitsProcessor, cfg_alpha: Option<f64>, config: Config, ) -> Self
pub fn step_idx(&self) -> usize
pub fn config(&self) -> &Config
pub fn step( &mut self, prev_text_token: u32, allowed_tokens: AllowedTokens, conditions: Option<&Condition>, ) -> Result<u32>
pub fn overwrite_last_text_token(&mut self, text_token: u32) -> Result<()>
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>>
pub fn audio_codebooks(&self) -> usize
pub fn device(&self) -> &Device
pub fn dtype(&self) -> DType
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