Struct fastembed::FlagEmbedding
source · pub struct FlagEmbedding { /* private fields */ }
Expand description
Rust representation of the FlagEmbedding model
Implementations§
source§impl FlagEmbedding
impl FlagEmbedding
sourcepub fn try_new(options: InitOptions) -> Result<Self>
pub fn try_new(options: InitOptions) -> Result<Self>
Try to generate a new FlagEmbedding Instance
Uses the highest level of Graph optimization
Uses the total number of CPUs available as the number of intra-threads
sourcepub fn list_supported_models() -> Vec<ModelInfo>
pub fn list_supported_models() -> Vec<ModelInfo>
Retrieve a list of supported modelsc
Trait Implementations§
source§impl<S: AsRef<str> + Send + Sync> EmbeddingBase<S> for FlagEmbedding
impl<S: AsRef<str> + Send + Sync> EmbeddingBase<S> for FlagEmbedding
EmbeddingBase implementation for FlagEmbedding
Generic type to accept String, &str, OsString, &OsStr
source§fn embed(
&self,
texts: Vec<S>,
batch_size: Option<usize>
) -> Result<Vec<Embedding>>
fn embed( &self, texts: Vec<S>, batch_size: Option<usize> ) -> Result<Vec<Embedding>>
The base embedding method for generating sentence embeddings
source§fn passage_embed(
&self,
texts: Vec<S>,
batch_size: Option<usize>
) -> Result<Vec<Embedding>>
fn passage_embed( &self, texts: Vec<S>, batch_size: Option<usize> ) -> Result<Vec<Embedding>>
Generate sentence embeddings for passages, pre-fixed with “passage”
source§fn query_embed(&self, query: S) -> Result<Embedding>
fn query_embed(&self, query: S) -> Result<Embedding>
Generate embeddings for user queries pre-fixed with “query”
Auto Trait Implementations§
impl RefUnwindSafe for FlagEmbedding
impl Send for FlagEmbedding
impl Sync for FlagEmbedding
impl Unpin for FlagEmbedding
impl UnwindSafe for FlagEmbedding
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