pub struct SentenceEmbeddingsConfig {
    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,
}
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

Trait Implementations§

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more