pub struct LmModel { /* private fields */ }Implementations§
Source§impl LmModel
impl LmModel
pub fn new(cfg: &Config, vb: MaybeQuantizedVarBuilder<'_>) -> Result<Self>
pub fn batched( batch_size: usize, cfg: &Config, vb: MaybeQuantizedVarBuilder<'_>, ) -> Result<Self>
pub fn new_( batch_size: Option<usize>, cfg: &Config, vb: MaybeQuantizedVarBuilder<'_>, ) -> Result<Self>
pub fn condition_provider(&self) -> Option<&ConditionProvider>
pub fn reset_state(&mut self)
pub fn in_audio_codebooks(&self) -> usize
pub fn audio_pad_token(&self) -> u32
pub fn text_start_token(&self) -> u32
pub fn generated_audio_codebooks(&self) -> usize
pub fn is_quantized(&self) -> bool
pub fn device(&self) -> &Device
pub fn dtype(&self) -> DType
pub fn forward( &mut self, text_ids: Option<Tensor>, audio_ids: Vec<Option<Tensor>>, mask: &StreamMask, ) -> Result<(Tensor, Tensor)>
pub fn extra_heads(&self, vs: &Tensor) -> Result<Vec<Tensor>>
pub fn forward_cond( &mut self, text_ids: Option<Tensor>, audio_ids: Vec<Option<Tensor>>, conditions: Option<&Condition>, mask: &StreamMask, ) -> Result<(Tensor, Tensor)>
pub fn maybe_precompute_ca_kv( &self, ca_src: Option<CaSrc>, ) -> Result<Option<CaSrc>>
pub fn forward_ca( &mut self, text_ids: Option<Tensor>, audio_ids: Vec<Option<Tensor>>, ca_src: &CaSrc, conditions: Option<&Condition>, mask: &StreamMask, ) -> Result<(Tensor, Tensor)>
pub fn depformer_sample( &mut self, xs: &Tensor, text_token: Option<u32>, forced_audio_tokens: &[Option<u32>], lp: &mut LogitsProcessor, ) -> Result<Option<Vec<u32>>>
pub fn depformer_sample_cfg( &mut self, xs: &Tensor, cfg_alpha: f64, text_token: Option<u32>, forced_audio_tokens: &[Option<u32>], lp: &mut LogitsProcessor, ) -> Result<Option<Vec<u32>>>
pub fn reset_batch_idx( &mut self, batch_idx: usize, batch_size: usize, ) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LmModel
impl !RefUnwindSafe for LmModel
impl Send for LmModel
impl Sync for LmModel
impl Unpin for LmModel
impl !UnwindSafe for LmModel
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> 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>
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