



'''simple docstring'''


import functools
import operator

from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowercase_   :					int        =     logging.get_logger(__name__)

lowercase_   :					Any        =     {
    '''facebook/wav2vec2-base-960h''': '''https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json''',
    # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2
}




class   __UpperCamelCase							(SCREAMING_SNAKE_CASE_      ):
	__A      	=       '''wav2vec2'''







	def __init__(     self			,					_lowerCAmelCase=32			,					_lowerCAmelCase=768			,					_lowerCAmelCase=12			,					_lowerCAmelCase=12			,					_lowerCAmelCase=3072			,					_lowerCAmelCase="gelu"			,					_lowerCAmelCase=0.1			,					_lowerCAmelCase=0.1			,					_lowerCAmelCase=0.1			,					_lowerCAmelCase=0.0			,					_lowerCAmelCase=0.0			,					_lowerCAmelCase=0.1			,					_lowerCAmelCase=0.1			,					_lowerCAmelCase=0.02			,					_lowerCAmelCase=1E-5			,					_lowerCAmelCase="group"			,					_lowerCAmelCase="gelu"			,					_lowerCAmelCase=(512, 512, 512, 512, 512, 512, 512)			,					_lowerCAmelCase=(5, 2, 2, 2, 2, 2, 2)			,					_lowerCAmelCase=(10, 3, 3, 3, 3, 2, 2)			,					_lowerCAmelCase=False			,					_lowerCAmelCase=128			,					_lowerCAmelCase=16			,					_lowerCAmelCase=False			,					_lowerCAmelCase=True			,					_lowerCAmelCase=0.05			,					_lowerCAmelCase=10			,					_lowerCAmelCase=2			,					_lowerCAmelCase=0.0			,					_lowerCAmelCase=10			,					_lowerCAmelCase=0			,					_lowerCAmelCase=320			,					_lowerCAmelCase=2			,					_lowerCAmelCase=0.1			,					_lowerCAmelCase=100			,					_lowerCAmelCase=256			,					_lowerCAmelCase=256			,					_lowerCAmelCase=0.1			,					_lowerCAmelCase="sum"			,					_lowerCAmelCase=False			,					_lowerCAmelCase=False			,					_lowerCAmelCase=256			,					_lowerCAmelCase=(512, 512, 512, 512, 1500)			,					_lowerCAmelCase=(5, 3, 3, 1, 1)			,					_lowerCAmelCase=(1, 2, 3, 1, 1)			,					_lowerCAmelCase=512			,					_lowerCAmelCase=0			,					_lowerCAmelCase=1			,					_lowerCAmelCase=2			,					_lowerCAmelCase=False			,					_lowerCAmelCase=3			,					_lowerCAmelCase=2			,					_lowerCAmelCase=3			,					_lowerCAmelCase=None			,					_lowerCAmelCase=None			,					**_lowerCAmelCase			,					)     ->     Union[str, Any]:
							'''simple docstring'''






							super().__init__(**snake_case__			,					pad_token_id=snake_case__			,					bos_token_id=snake_case__			,					eos_token_id=snake_case__    )
							lowercase   =				hidden_size
							lowercase   =				feat_extract_norm
							lowercase   =				feat_extract_activation
							lowercase   =				list(snake_case__    )
							lowercase   =				list(snake_case__    )
							lowercase   =				list(snake_case__    )
							lowercase   =				conv_bias
							lowercase   =				num_conv_pos_embeddings
							lowercase   =				num_conv_pos_embedding_groups
							lowercase   =				len(self.conv_dim    )
							lowercase   =				num_hidden_layers
							lowercase   =				intermediate_size
							lowercase   =				hidden_act
							lowercase   =				num_attention_heads
							lowercase   =				hidden_dropout
							lowercase   =				attention_dropout
							lowercase   =				activation_dropout
							lowercase   =				feat_proj_dropout
							lowercase   =				final_dropout
							lowercase   =				layerdrop
							lowercase   =				layer_norm_eps
							lowercase   =				initializer_range
							lowercase   =				vocab_size
							lowercase   =				do_stable_layer_norm
							lowercase   =				use_weighted_layer_sum

							if (
							    (len(self.conv_stride    ) != self.num_feat_extract_layers)
							    or (len(self.conv_kernel    ) != self.num_feat_extract_layers)
							    or (len(self.conv_dim    ) != self.num_feat_extract_layers)
							):
													raise ValueError(
													    """Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =="""
													    """ `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ="""
													    F""" {len(self.conv_dim    )}`, `len(config.conv_stride) = {len(self.conv_stride    )}`,"""
													    F""" `len(config.conv_kernel) = {len(self.conv_kernel    )}`."""    )

							# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
							lowercase   =				apply_spec_augment
							lowercase   =				mask_time_prob
							lowercase   =				mask_time_length
							lowercase   =				mask_time_min_masks
							lowercase   =				mask_feature_prob
							lowercase   =				mask_feature_length
							lowercase   =				mask_feature_min_masks

							# parameters for pretraining with codevector quantized representations
							lowercase   =				num_codevectors_per_group
							lowercase   =				num_codevector_groups
							lowercase   =				contrastive_logits_temperature
							lowercase   =				feat_quantizer_dropout
							lowercase   =				num_negatives
							lowercase   =				codevector_dim
							lowercase   =				proj_codevector_dim
							lowercase   =				diversity_loss_weight

							# ctc loss
							lowercase   =				ctc_loss_reduction
							lowercase   =				ctc_zero_infinity

							# adapter
							lowercase   =				add_adapter
							lowercase   =				adapter_kernel_size
							lowercase   =				adapter_stride
							lowercase   =				num_adapter_layers
							lowercase   =				output_hidden_size or hidden_size
							lowercase   =				adapter_attn_dim

							# SequenceClassification-specific parameter. Feel free to ignore for other classes.
							lowercase   =				classifier_proj_size

							# XVector-specific parameters. Feel free to ignore for other classes.
							lowercase   =				list(snake_case__    )
							lowercase   =				list(snake_case__    )
							lowercase   =				list(snake_case__    )
							lowercase   =				xvector_output_dim







	@property
	def 	_a (     self    )     ->     Any:
							'''simple docstring'''






							return functools.reduce(operator.mul			,					self.conv_stride			,					1    )



A						=			'\n# Transformers installation\n! pip install transformers datasets\n# To install from source instead of the last release, comment the command above and uncomment the following one.\n# ! pip install git+https://github.com/huggingface/transformers.git\n'

A						=			[{'type': 'code', 'content': INSTALL_CONTENT}]
A						=			{
    '{processor_class}': 'FakeProcessorClass',
    '{model_class}': 'FakeModelClass',
    '{object_class}': 'FakeObjectClass',
}