pub struct MoshiSession { /* private fields */ }Expand description
Moshi session — LM + Mimi codec + tokenizer.
Implementations§
Source§impl MoshiSession
impl MoshiSession
pub fn open( moshi_dir: impl AsRef<Path>, mimi_dir: impl AsRef<Path>, variant: MoshiVariant, ) -> Result<MoshiSession, Error>
pub fn open_on( moshi_dir: impl AsRef<Path>, mimi_dir: impl AsRef<Path>, variant: MoshiVariant, device: Device, ) -> Result<MoshiSession, Error>
pub fn open_with_checkpoint( moshi_dir: impl AsRef<Path>, mimi_dir: impl AsRef<Path>, variant: MoshiVariant, device: Device, checkpoint: MoshiCheckpoint, ) -> Result<MoshiSession, Error>
pub fn open_default(variant: MoshiVariant) -> Result<MoshiSession, Error>
pub fn open_default_on( variant: MoshiVariant, device: Device, ) -> Result<MoshiSession, Error>
pub fn variant(&self) -> MoshiVariant
pub fn device(&self) -> Device
pub fn checkpoint(&self) -> MoshiCheckpoint
pub fn moshi_dir(&self) -> &Path
pub fn gen_cfg_internal(&self) -> &GenerateConfig
pub fn into_parts(self) -> Result<MoshiSessionParts, Error>
Sourcepub fn generate_one_way(
&mut self,
prompt: &str,
cfg: &GenerationConfig,
) -> Result<GenerationResult, Error>
pub fn generate_one_way( &mut self, prompt: &str, cfg: &GenerationConfig, ) -> Result<GenerationResult, Error>
One-way TTS from a text prompt (blank user audio).
Sourcepub fn generate_duplex(
&mut self,
user_wav: impl AsRef<Path>,
cfg: &GenerationConfig,
) -> Result<GenerationResult, Error>
pub fn generate_duplex( &mut self, user_wav: impl AsRef<Path>, cfg: &GenerationConfig, ) -> Result<GenerationResult, Error>
Full-duplex: encode user WAV with Mimi, condition generation, decode Moshi reply.
Auto Trait Implementations§
impl !Freeze for MoshiSession
impl !RefUnwindSafe for MoshiSession
impl !Sync for MoshiSession
impl !UnwindSafe for MoshiSession
impl Send for MoshiSession
impl Unpin for MoshiSession
impl UnsafeUnpin for MoshiSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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