pub struct SentenceEmbeddingsConfig {Show 13 fields
pub modules_config_resource: Box<dyn ResourceProvider + Send>,
pub transformer_type: ModelType,
pub transformer_config_resource: Box<dyn ResourceProvider + Send>,
pub transformer_weights_resource: Box<dyn ResourceProvider + Send>,
pub pooling_config_resource: Box<dyn ResourceProvider + Send>,
pub dense_config_resource: Option<Box<dyn ResourceProvider + Send>>,
pub dense_weights_resource: Option<Box<dyn ResourceProvider + Send>>,
pub sentence_bert_config_resource: Box<dyn ResourceProvider + Send>,
pub tokenizer_config_resource: Box<dyn ResourceProvider + Send>,
pub tokenizer_vocab_resource: Box<dyn ResourceProvider + Send>,
pub tokenizer_merges_resource: Option<Box<dyn ResourceProvider + Send>>,
pub device: Device,
pub kind: Option<Kind>,
}
Expand description
§Configuration for sentence embeddings
Contains information regarding the transformer model to load, the optional extra layers, and device to place the model on.
Fields§
§modules_config_resource: Box<dyn ResourceProvider + Send>
Modules configuration resource, contains layers definition
transformer_type: ModelType
Transformer model type
transformer_config_resource: Box<dyn ResourceProvider + Send>
Transformer model configuration resource
transformer_weights_resource: Box<dyn ResourceProvider + Send>
Transformer weights resource
pooling_config_resource: Box<dyn ResourceProvider + Send>
Pooling layer configuration resource
dense_config_resource: Option<Box<dyn ResourceProvider + Send>>
Optional dense layer configuration resource
dense_weights_resource: Option<Box<dyn ResourceProvider + Send>>
Optional dense layer weights resource
sentence_bert_config_resource: Box<dyn ResourceProvider + Send>
Sentence BERT specific configuration resource
tokenizer_config_resource: Box<dyn ResourceProvider + Send>
Transformer’s tokenizer configuration resource
tokenizer_vocab_resource: Box<dyn ResourceProvider + Send>
Transformer’s tokenizer vocab resource
tokenizer_merges_resource: Option<Box<dyn ResourceProvider + Send>>
Optional transformer’s tokenizer merges resource
device: Device
Device to place the transformer model on
kind: Option<Kind>
Model weights precision. If not provided, will default to full precision on CPU, or the loaded weights precision otherwise
Trait Implementations§
Source§impl From<SentenceEmbeddingsModelType> for SentenceEmbeddingsConfig
impl From<SentenceEmbeddingsModelType> for SentenceEmbeddingsConfig
Source§fn from(model_type: SentenceEmbeddingsModelType) -> Self
fn from(model_type: SentenceEmbeddingsModelType) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SentenceEmbeddingsConfig
impl !RefUnwindSafe for SentenceEmbeddingsConfig
impl Send for SentenceEmbeddingsConfig
impl Sync for SentenceEmbeddingsConfig
impl Unpin for SentenceEmbeddingsConfig
impl !UnwindSafe for SentenceEmbeddingsConfig
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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