pub enum SentenceEmbeddingsOption {
Bert(BertForSentenceEmbeddings),
DistilBert(DistilBertForSentenceEmbeddings),
Roberta(RobertaForSentenceEmbeddings),
Albert(AlbertForSentenceEmbeddings),
T5(T5ForSentenceEmbeddings),
}Expand description
Variants§
Bert(BertForSentenceEmbeddings)
Bert for Sentence Embeddings
DistilBert(DistilBertForSentenceEmbeddings)
DistilBert for Sentence Embeddings
Roberta(RobertaForSentenceEmbeddings)
Roberta for Sentence Embeddings
Albert(AlbertForSentenceEmbeddings)
Albert for Sentence Embeddings
T5(T5ForSentenceEmbeddings)
T5 for Sentence Embeddings
Implementations§
source§impl SentenceEmbeddingsOption
impl SentenceEmbeddingsOption
sourcepub fn new<'p, P>(
transformer_type: ModelType,
p: P,
config: &ConfigOption
) -> Result<Self, RustBertError>
pub fn new<'p, P>( transformer_type: ModelType, p: P, config: &ConfigOption ) -> Result<Self, RustBertError>
Instantiate a new sentence embeddings transformer of the supplied type.
Arguments
transformer_type-ModelTypeindicating the transformer model type to load (must match with the actual data to be loaded)p-tch::nn::Pathpath to the model file to load (e.g. rust_model.ot)config- A configuration (the transformer model type of the configuration must be compatible with the value fortransformer_type)
Auto Trait Implementations§
impl RefUnwindSafe for SentenceEmbeddingsOption
impl Send for SentenceEmbeddingsOption
impl !Sync for SentenceEmbeddingsOption
impl Unpin for SentenceEmbeddingsOption
impl UnwindSafe for SentenceEmbeddingsOption
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