pub struct Wav2Vec2BertConfig {Show 15 fields
pub hidden_size: usize,
pub num_hidden_layers: usize,
pub num_attention_heads: usize,
pub intermediate_size: usize,
pub feature_projection_input_dim: usize,
pub layer_norm_eps: f64,
pub hidden_act: String,
pub position_embeddings_type: String,
pub left_max_position_embeddings: usize,
pub right_max_position_embeddings: usize,
pub conv_depthwise_kernel_size: usize,
pub add_adapter: bool,
pub apply_spec_augment: bool,
pub use_intermediate_ffn_before_adapter: bool,
pub model_type: Option<String>,
}Expand description
Wav2Vec2-BERT model configuration (e.g. facebook/w2v-bert-2.0).
Fields§
§num_attention_heads: usize§intermediate_size: usize§feature_projection_input_dim: usize§layer_norm_eps: f64§position_embeddings_type: String§left_max_position_embeddings: usize§right_max_position_embeddings: usize§conv_depthwise_kernel_size: usize§add_adapter: bool§apply_spec_augment: bool§use_intermediate_ffn_before_adapter: bool§model_type: Option<String>Present in HF configs; ignored at inference when apply_spec_augment=false.
Implementations§
Source§impl Wav2Vec2BertConfig
impl Wav2Vec2BertConfig
pub fn from_file(path: &Path) -> Result<Wav2Vec2BertConfig, Error>
pub fn head_dim(&self) -> usize
pub fn num_relative_positions(&self) -> usize
Sourcepub fn w2v_bert_2_0() -> Wav2Vec2BertConfig
pub fn w2v_bert_2_0() -> Wav2Vec2BertConfig
Factory for the public W2v-BERT 2.0 checkpoint dimensions.
Trait Implementations§
Source§impl Clone for Wav2Vec2BertConfig
impl Clone for Wav2Vec2BertConfig
Source§fn clone(&self) -> Wav2Vec2BertConfig
fn clone(&self) -> Wav2Vec2BertConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Wav2Vec2BertConfig
impl Debug for Wav2Vec2BertConfig
Source§impl<'de> Deserialize<'de> for Wav2Vec2BertConfig
impl<'de> Deserialize<'de> for Wav2Vec2BertConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Wav2Vec2BertConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Wav2Vec2BertConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Wav2Vec2BertConfig
impl RefUnwindSafe for Wav2Vec2BertConfig
impl Send for Wav2Vec2BertConfig
impl Sync for Wav2Vec2BertConfig
impl Unpin for Wav2Vec2BertConfig
impl UnsafeUnpin for Wav2Vec2BertConfig
impl UnwindSafe for Wav2Vec2BertConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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