pub struct CandleEmbeddingProvider { /* private fields */ }Expand description
Local embedding provider backed by Candle and a BERT-style sentence model.
Implementations§
Source§impl CandleEmbeddingProvider
impl CandleEmbeddingProvider
Sourcepub fn from_local_files(
files: &CandleEmbeddingModelFiles,
device: Device,
max_length: usize,
) -> PopsamResult<Self>
pub fn from_local_files( files: &CandleEmbeddingModelFiles, device: Device, max_length: usize, ) -> PopsamResult<Self>
Loads a local Candle embedding provider from explicit model files.
Sourcepub fn from_hf_hub(
spec: &CandleEmbeddingModelSpec,
device: Device,
max_length: usize,
) -> PopsamResult<Self>
pub fn from_hf_hub( spec: &CandleEmbeddingModelSpec, device: Device, max_length: usize, ) -> PopsamResult<Self>
Downloads the configured model files from Hugging Face and loads them locally.
Sourcepub fn cpu(multilingual_default: bool) -> PopsamResult<Self>
pub fn cpu(multilingual_default: bool) -> PopsamResult<Self>
Convenience constructor for the default CPU-backed local model.
The current implementation always resolves to the multilingual default model.
Trait Implementations§
Source§impl EmbeddingProvider for CandleEmbeddingProvider
impl EmbeddingProvider for CandleEmbeddingProvider
Source§fn embed(&self, records: &[InputRecord]) -> PopsamResult<Vec<EmbeddedText>>
fn embed(&self, records: &[InputRecord]) -> PopsamResult<Vec<EmbeddedText>>
Embeds a batch of records and returns the corresponding vectors.
Auto Trait Implementations§
impl !Freeze for CandleEmbeddingProvider
impl !RefUnwindSafe for CandleEmbeddingProvider
impl Send for CandleEmbeddingProvider
impl Sync for CandleEmbeddingProvider
impl Unpin for CandleEmbeddingProvider
impl UnsafeUnpin for CandleEmbeddingProvider
impl !UnwindSafe for CandleEmbeddingProvider
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