pub struct DepFormer { /* private fields */ }Implementations§
Source§impl DepFormer
impl DepFormer
pub fn new( text_vocab_size: usize, audio_vocab_size: usize, main_transformer_dim: usize, cfg: &DepFormerConfig, vb: MaybeQuantizedVarBuilder<'_>, ) -> Result<Self>
Sourcepub fn sample(
&mut self,
xs: &Tensor,
text_token: Option<u32>,
forced_audio_tokens: &[Option<u32>],
lp: &mut LogitsProcessor,
) -> Result<Vec<u32>>
pub fn sample( &mut self, xs: &Tensor, text_token: Option<u32>, forced_audio_tokens: &[Option<u32>], lp: &mut LogitsProcessor, ) -> Result<Vec<u32>>
Run a transformer sampling step, getting a token id per codebook.
xsis the previous layer hidden state.
pub fn sample_cfg( &mut self, xs: &Tensor, cfg_alpha: f64, text_token: Option<u32>, forced_audio_tokens: &[Option<u32>], lp: &mut LogitsProcessor, ) -> Result<Vec<u32>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DepFormer
impl !RefUnwindSafe for DepFormer
impl Send for DepFormer
impl Sync for DepFormer
impl Unpin for DepFormer
impl !UnwindSafe for DepFormer
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