pub struct Bgem3Embedding {
pub tokenizer: Tokenizer,
pub model: Bgem3Model,
/* private fields */
}Available on crate feature
onnx only.Expand description
Rust representation of the BGE-M3 joint embedding model
Fields§
§tokenizer: Tokenizer§model: Bgem3ModelImplementations§
Source§impl Bgem3Embedding
impl Bgem3Embedding
Sourcepub fn try_new(options: Bgem3InitOptions) -> Result<Self>
Available on crate feature hf-hub only.
pub fn try_new(options: Bgem3InitOptions) -> Result<Self>
hf-hub only.Try to generate a new Bgem3Embedding Instance
Uses the highest level of Graph optimization
Uses the total number of CPUs available as the number of intra-threads
Sourcepub fn try_new_from_user_defined(
model: UserDefinedBgem3Model,
options: InitOptionsUserDefined,
) -> Result<Self>
pub fn try_new_from_user_defined( model: UserDefinedBgem3Model, options: InitOptionsUserDefined, ) -> Result<Self>
Create a Bgem3Embedding instance from model files provided by the user.
Sourcepub fn try_new_from_path(
model_path: impl AsRef<Path>,
tokenizer_files: TokenizerFiles,
options: InitOptionsUserDefined,
) -> Result<Self>
pub fn try_new_from_path( model_path: impl AsRef<Path>, tokenizer_files: TokenizerFiles, options: InitOptionsUserDefined, ) -> Result<Self>
Create a Bgem3Embedding instance from an ONNX model on disk.
model_path is a .onnx file or a directory containing model.onnx.
Supports split external data files (model.onnx + model.onnx_data).
Sourcepub fn list_supported_models() -> Vec<ModelInfo<Bgem3Model>>
pub fn list_supported_models() -> Vec<ModelInfo<Bgem3Model>>
Retrieve a list of supported models
Sourcepub fn get_model_info(model: &Bgem3Model) -> ModelInfo<Bgem3Model>
pub fn get_model_info(model: &Bgem3Model) -> ModelInfo<Bgem3Model>
Get ModelInfo from Bgem3Model
Auto Trait Implementations§
impl !Freeze for Bgem3Embedding
impl !RefUnwindSafe for Bgem3Embedding
impl !UnwindSafe for Bgem3Embedding
impl Send for Bgem3Embedding
impl Sync for Bgem3Embedding
impl Unpin for Bgem3Embedding
impl UnsafeUnpin for Bgem3Embedding
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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