pub struct LocalEmbedder { /* private fields */ }Expand description
On-device embeddings from a LocalModel, for knowledge search with
no network. Mean-pooled, L2-normalized vectors (the mean of the
token rows); batches of at most 32 texts run off the async runtime.
Implementations§
Source§impl LocalEmbedder
impl LocalEmbedder
Sourcepub fn new(model: Arc<dyn LocalModel>) -> Result<Self, LocalError>
pub fn new(model: Arc<dyn LocalModel>) -> Result<Self, LocalError>
Wraps a model that can embed.
Input: the model. Output: the embedder, or
Unsupported("embeddings") when its embedding size is 0.
Trait Implementations§
Source§impl Debug for LocalEmbedder
impl Debug for LocalEmbedder
Source§impl Embedder for LocalEmbedder
impl Embedder for LocalEmbedder
Auto Trait Implementations§
impl !RefUnwindSafe for LocalEmbedder
impl !UnwindSafe for LocalEmbedder
impl Forget for LocalEmbedder
impl Freeze for LocalEmbedderwhere
*const ArcInner<dyn LocalModel> is !null: Freeze,
PhantomData<ArcInner<dyn LocalModel>>: Freeze,
impl Move for LocalEmbedder
impl Send for LocalEmbedder
impl Sync for LocalEmbedder
impl Unpin for LocalEmbedder
impl UnsafeUnpin for LocalEmbedderwhere
*const ArcInner<dyn LocalModel> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn LocalModel>>: UnsafeUnpin,
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