pub struct T5Config {Show 24 fields
pub dropout_rate: f64,
pub d_model: i64,
pub d_ff: i64,
pub d_kv: i64,
pub decoder_start_token_id: Option<i64>,
pub bos_token_id: Option<i64>,
pub eos_token_id: Option<i64>,
pub forced_bos_token_id: Option<i64>,
pub forced_eos_token_id: Option<i64>,
pub initializer_factor: f64,
pub is_encoder_decoder: Option<bool>,
pub layer_norm_epsilon: f64,
pub num_heads: i64,
pub num_layers: i64,
pub output_past: Option<bool>,
pub pad_token_id: Option<i64>,
pub relative_attention_num_buckets: i64,
pub relative_attention_max_distance: Option<i64>,
pub vocab_size: i64,
pub feed_forward_proj: Option<FeedForwardProj>,
pub tie_word_embeddings: Option<bool>,
pub task_specific_params: Option<TaskSpecificParams>,
pub output_attentions: Option<bool>,
pub output_hidden_states: Option<bool>,
}
Expand description
§T5 model configuration
Defines the T5 model architecture (e.g. number of layers, hidden layer size, label mapping…)
Fields§
§dropout_rate: f64
§d_model: i64
§d_ff: i64
§d_kv: i64
§decoder_start_token_id: Option<i64>
§bos_token_id: Option<i64>
§eos_token_id: Option<i64>
§forced_bos_token_id: Option<i64>
§forced_eos_token_id: Option<i64>
§initializer_factor: f64
§is_encoder_decoder: Option<bool>
§layer_norm_epsilon: f64
§num_heads: i64
§num_layers: i64
§output_past: Option<bool>
§pad_token_id: Option<i64>
§relative_attention_num_buckets: i64
§relative_attention_max_distance: Option<i64>
§vocab_size: i64
§feed_forward_proj: Option<FeedForwardProj>
§tie_word_embeddings: Option<bool>
§task_specific_params: Option<TaskSpecificParams>
§output_attentions: Option<bool>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for T5Config
impl<'de> Deserialize<'de> for T5Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&LongT5Config> for T5Config
impl From<&LongT5Config> for T5Config
Source§fn from(val: &LongT5Config) -> T5Config
fn from(val: &LongT5Config) -> T5Config
Converts to this type from the input type.
Source§impl TryFrom<&ConfigOption> for T5Config
impl TryFrom<&ConfigOption> for T5Config
Source§type Error = RustBertError
type Error = RustBertError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for T5Config
impl RefUnwindSafe for T5Config
impl Send for T5Config
impl Sync for T5Config
impl Unpin for T5Config
impl UnwindSafe for T5Config
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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