pub struct Fastembed { /* private fields */ }Expand description
A loaded Fastembed model: the transport that embeds in the calling
process. Clones share the loaded model. Pair it with the
text_embeddings wire of the model it loaded: the wire names the model
and width that spans and capabilities report, and the transport embeds
with whatever it loaded. In-process execution reports no raw payload,
usage, or request id.
Implementations§
Source§impl Fastembed
impl Fastembed
Sourcepub fn load(model: &FastembedModel) -> Result<Self, FastembedError>
pub fn load(model: &FastembedModel) -> Result<Self, FastembedError>
Loads model, downloading it when necessary and reporting download
progress on standard output.
Sourcepub fn embedding(
&self,
model: &FastembedModel,
ndims: Option<usize>,
) -> Result<Model<Local<Embedding>, Self>, FastembedError>
pub fn embedding( &self, model: &FastembedModel, ndims: Option<usize>, ) -> Result<Model<Local<Embedding>, Self>, FastembedError>
The embedding model of model at ndims dimensions, on this
runtime: the text_embeddings wire, which fails for a model
fastembed does not know when ndims is None. model names what
spans and capabilities report; this runtime embeds with whatever it
loaded.
Sourcepub fn from_user_defined(
user_defined_model: UserDefinedEmbeddingModel,
) -> Result<Self, FastembedError>
pub fn from_user_defined( user_defined_model: UserDefinedEmbeddingModel, ) -> Result<Self, FastembedError>
Loads a caller-supplied ONNX model.
Trait Implementations§
Source§impl Transport<Local<Embedding>> for Fastembed
impl Transport<Local<Embedding>> for Fastembed
Source§fn send(
&self,
texts: Vec<String>,
_exchange: Exchange,
) -> Opening<Step<Embedding>> ⓘ
fn send( &self, texts: Vec<String>, _exchange: Exchange, ) -> Opening<Step<Embedding>> ⓘ
Open the reply to one payload. Nothing is sent until the opening is
first polled. A payload the transport cannot send in the exchange’s
mode fails the opening; a failure after the reply opened is its last
frame.
Auto Trait Implementations§
impl !RefUnwindSafe for Fastembed
impl !UnwindSafe for Fastembed
impl Freeze for Fastembed
impl Send for Fastembed
impl Sync for Fastembed
impl Unpin for Fastembed
impl UnsafeUnpin for Fastembed
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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