pub struct ConversionModel {
pub model_type: ModelType,
pub config: ModelConfig,
/* private fields */
}Expand description
Main conversion model interface
Fields§
§model_type: ModelTypeModel type
config: ModelConfigModel configuration
Implementations§
Source§impl ConversionModel
impl ConversionModel
Sourcepub fn with_config(model_type: ModelType, config: ModelConfig) -> Self
pub fn with_config(model_type: ModelType, config: ModelConfig) -> Self
Create model with custom configuration
Sourcepub async fn load_from_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub async fn load_from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Load model from file path
Sourcepub async fn load_from_bytes(
bytes: &[u8],
model_type: ModelType,
) -> Result<Self>
pub async fn load_from_bytes( bytes: &[u8], model_type: ModelType, ) -> Result<Self>
Load model from bytes
Sourcepub async fn process_tensor(&self, input: &Tensor) -> Result<Tensor>
pub async fn process_tensor(&self, input: &Tensor) -> Result<Tensor>
Process audio tensor with the model
Sourcepub fn set_device(&mut self, device: Device) -> Result<()>
pub fn set_device(&mut self, device: Device) -> Result<()>
Set model device
Trait Implementations§
Source§impl Debug for ConversionModel
impl Debug for ConversionModel
Auto Trait Implementations§
impl Freeze for ConversionModel
impl !RefUnwindSafe for ConversionModel
impl Send for ConversionModel
impl Sync for ConversionModel
impl Unpin for ConversionModel
impl UnsafeUnpin for ConversionModel
impl !UnwindSafe for ConversionModel
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