pub struct QueryModel { /* private fields */ }Expand description
A query-side embedder that never loads the weight table: it reads the
vocabulary, the row scales and only the rows of the query’s own tokens
(about 512 bytes each) with positioned reads. It reproduces
Model::embed under Tokenization::Identifiers exactly (a test checks
this); build the stored vectors with the full Model.
Implementations§
Source§impl QueryModel
impl QueryModel
Sourcepub fn open(dir: &Path) -> Option<QueryModel>
pub fn open(dir: &Path) -> Option<QueryModel>
Open an installed model folder (model.q8 and vocab.txt); None when
the file is missing or its size does not match its header.
Auto Trait Implementations§
impl Freeze for QueryModel
impl RefUnwindSafe for QueryModel
impl Send for QueryModel
impl Sync for QueryModel
impl Unpin for QueryModel
impl UnsafeUnpin for QueryModel
impl UnwindSafe for QueryModel
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> 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