pub struct HuggingFaceTextVectorizer { /* private fields */ }Expand description
HuggingFace local embedding adapter backed by ONNX Runtime.
Uses the fastembed crate to run embedding models locally. Models are
automatically downloaded from the HuggingFace Hub on first use and cached
on disk.
This vectorizer implements Vectorizer for synchronous embedding
generation. For async use cases, wrap it with
tokio::task::spawn_blocking or use it with the synchronous semantic
extension APIs.
Implementations§
Source§impl HuggingFaceTextVectorizer
impl HuggingFaceTextVectorizer
Sourcepub fn new(config: HuggingFaceConfig) -> Result<Self>
pub fn new(config: HuggingFaceConfig) -> Result<Self>
Creates a new HuggingFace local vectorizer.
This may download the model from HuggingFace Hub on first invocation.
§Errors
Returns an error if the model cannot be loaded.
Trait Implementations§
Source§impl Debug for HuggingFaceTextVectorizer
impl Debug for HuggingFaceTextVectorizer
impl Send for HuggingFaceTextVectorizer
impl Sync for HuggingFaceTextVectorizer
Auto Trait Implementations§
impl !Freeze for HuggingFaceTextVectorizer
impl RefUnwindSafe for HuggingFaceTextVectorizer
impl Unpin for HuggingFaceTextVectorizer
impl UnsafeUnpin for HuggingFaceTextVectorizer
impl UnwindSafe for HuggingFaceTextVectorizer
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 moreCreates a shared type from an unshared type.