pub struct HuggingFaceEmbedder { /* private fields */ }Expand description
HuggingFace embeddings provider
Implementations§
Source§impl HuggingFaceEmbedder
impl HuggingFaceEmbedder
Sourcepub fn new(config: HuggingFaceEmbedderConfig) -> Result<Self, EmbeddingError>
pub fn new(config: HuggingFaceEmbedderConfig) -> Result<Self, EmbeddingError>
Create a new HuggingFace embedder
Trait Implementations§
Source§impl Embedder for HuggingFaceEmbedder
impl Embedder for HuggingFaceEmbedder
Source§fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, EmbeddingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn embed<'life0, 'life1, 'async_trait>(
&'life0 self,
text: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<f32>, EmbeddingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Embed a single text into a vector
Source§fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, EmbeddingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn embed_batch<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
texts: &'life1 [&'life2 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<Vec<f32>>, EmbeddingError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Embed multiple texts into vectors
Source§fn dimensions(&self) -> usize
fn dimensions(&self) -> usize
Get the dimension of embeddings produced by this embedder
Source§fn model_name(&self) -> &str
fn model_name(&self) -> &str
Get the model name (for logging/debugging)
Auto Trait Implementations§
impl Freeze for HuggingFaceEmbedder
impl !RefUnwindSafe for HuggingFaceEmbedder
impl Send for HuggingFaceEmbedder
impl Sync for HuggingFaceEmbedder
impl Unpin for HuggingFaceEmbedder
impl !UnwindSafe for HuggingFaceEmbedder
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more