pub trait AudioEmbeddingModel: ModelInfo {
// Required methods
fn embed<'life0, 'async_trait>(
&'life0 self,
audios: Vec<AudioInput>,
) -> Pin<Box<dyn Future<Output = Result<EmbedResult>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn dimensions(&self) -> u32;
// Provided method
fn warmup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait,
'life0: 'async_trait { ... }
}Expand description
A model that produces dense vector embeddings from audio.
One vector is returned per input audio, each of dimension
dimensions. Use cases include
CLAP-style audio similarity, music tagging, and audio-text retrieval.
Required Methods§
Sourcefn embed<'life0, 'async_trait>(
&'life0 self,
audios: Vec<AudioInput>,
) -> Pin<Box<dyn Future<Output = Result<EmbedResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn embed<'life0, 'async_trait>(
&'life0 self,
audios: Vec<AudioInput>,
) -> Pin<Box<dyn Future<Output = Result<EmbedResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Embed a batch of audio inputs.
§Errors
Returns an error if the provider cannot decode an input or runs out of memory.
Sourcefn dimensions(&self) -> u32
fn dimensions(&self) -> u32
The dimensionality of vectors produced by this model.