Skip to main content

Crate akuna_embed

Crate akuna_embed 

Source
Expand description

Simple text embedding models built with Burn.

§Example

use akuna_embed::{EmbeddingModel, TextEmbedding, TextEmbeddingOptions};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let model = TextEmbedding::new(TextEmbeddingOptions {
        model: EmbeddingModel::MiniLmL12,
        ..Default::default()
    })
    .await?;

    let single = model.embed("Hello world")?;
    assert!(!single.is_empty());

    let batch = model.embed_batch(&["Hello world", "Rust embeddings"], None)?;
    assert_eq!(batch.len(), 2);

    Ok(())
}

Structs§

TextEmbedding
Minimal text embedding interface inspired by fastembed-rs.
TextEmbeddingOptions
Options for TextEmbedding.

Enums§

EmbeddingModel
Supported embedding model checkpoints.

Type Aliases§

DefaultBackend
DefaultDevice