






import math

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


__UpperCAmelCase								=						logging.get_logger(__name__)

__UpperCAmelCase								=						{
    'facebook/data2vec-base-960h': 'https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json',
    # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio
}



class   lowerCamelCase      (_snake_case			):







		'''simple docstring'''



		_snake_case    :    Optional[Any]       						=  '''data2vec-audio'''



		def __init__(							self				,		_UpperCamelCase=3_2				,		_UpperCamelCase=7_6_8				,		_UpperCamelCase=1_2				,		_UpperCamelCase=1_2				,		_UpperCamelCase=3_0_7_2				,		_UpperCamelCase="gelu"				,		_UpperCamelCase=0.1				,		_UpperCamelCase=0.1				,		_UpperCamelCase=0.1				,		_UpperCamelCase=0.0				,		_UpperCamelCase=0.1				,		_UpperCamelCase=0.1				,		_UpperCamelCase=0.02				,		_UpperCamelCase=1E-5				,		_UpperCamelCase="gelu"				,		_UpperCamelCase=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)				,		_UpperCamelCase=(5, 2, 2, 2, 2, 2, 2)				,		_UpperCamelCase=(1_0, 3, 3, 3, 3, 2, 2)				,		_UpperCamelCase=False				,		_UpperCamelCase=1_6				,		_UpperCamelCase=1_9				,		_UpperCamelCase=5				,		_UpperCamelCase=0.05				,		_UpperCamelCase=1_0				,		_UpperCamelCase=2				,		_UpperCamelCase=0.0				,		_UpperCamelCase=1_0				,		_UpperCamelCase=0				,		_UpperCamelCase="sum"				,		_UpperCamelCase=False				,		_UpperCamelCase=False				,		_UpperCamelCase=2_5_6				,		_UpperCamelCase=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)				,		_UpperCamelCase=(5, 3, 3, 1, 1)				,		_UpperCamelCase=(1, 2, 3, 1, 1)				,		_UpperCamelCase=5_1_2				,		_UpperCamelCase=0				,		_UpperCamelCase=1				,		_UpperCamelCase=2				,		_UpperCamelCase=False				,		_UpperCamelCase=3				,		_UpperCamelCase=2				,		_UpperCamelCase=3				,		_UpperCamelCase=None				,		**_UpperCamelCase				,		)	->							Any:
							super().__init__(**_UpperCamelCase				,		pad_token_id=_UpperCamelCase				,		bos_token_id=_UpperCamelCase				,		eos_token_id=_UpperCamelCase   )
							UpperCAmelCase_    :      Optional[int]            =						hidden_size
							UpperCAmelCase_    :      Optional[int]            =						feat_extract_activation
							UpperCAmelCase_    :      Optional[Any]            =						list(_UpperCamelCase   )
							UpperCAmelCase_    :      int            =						list(_UpperCamelCase   )
							UpperCAmelCase_    :      Optional[int]            =						list(_UpperCamelCase   )
							UpperCAmelCase_    :      List[Any]            =						conv_bias
							UpperCAmelCase_    :      int            =						num_conv_pos_embeddings
							UpperCAmelCase_    :      int            =						num_conv_pos_embedding_groups
							UpperCAmelCase_    :      List[str]            =						conv_pos_kernel_size
							UpperCAmelCase_    :      List[Any]            =						len(self.conv_dim   )
							UpperCAmelCase_    :      Union[str, Any]            =						num_hidden_layers
							UpperCAmelCase_    :      Any            =						intermediate_size
							UpperCAmelCase_    :      List[Any]            =						hidden_act
							UpperCAmelCase_    :      int            =						num_attention_heads
							UpperCAmelCase_    :      Optional[Any]            =						hidden_dropout
							UpperCAmelCase_    :      Any            =						attention_dropout
							UpperCAmelCase_    :      Dict            =						activation_dropout
							UpperCAmelCase_    :      Optional[Any]            =						feat_proj_dropout
							UpperCAmelCase_    :      Any            =						final_dropout
							UpperCAmelCase_    :      Optional[Any]            =						layerdrop
							UpperCAmelCase_    :      Dict            =						layer_norm_eps
							UpperCAmelCase_    :      List[str]            =						initializer_range
							UpperCAmelCase_    :      Union[str, Any]            =						vocab_size
							UpperCAmelCase_    :      List[Any]            =						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
							UpperCAmelCase_    :      Tuple            =						mask_time_prob
							UpperCAmelCase_    :      int            =						mask_time_length
							UpperCAmelCase_    :      Tuple            =						mask_time_min_masks
							UpperCAmelCase_    :      Dict            =						mask_feature_prob
							UpperCAmelCase_    :      List[str]            =						mask_feature_length
							UpperCAmelCase_    :      Optional[Any]            =						mask_feature_min_masks

							# ctc loss
							UpperCAmelCase_    :      Dict            =						ctc_loss_reduction
							UpperCAmelCase_    :      Any            =						ctc_zero_infinity

							# adapter
							UpperCAmelCase_    :      List[Any]            =						add_adapter
							UpperCAmelCase_    :      Tuple            =						adapter_kernel_size
							UpperCAmelCase_    :      Tuple            =						adapter_stride
							UpperCAmelCase_    :      Any            =						num_adapter_layers
							UpperCAmelCase_    :      List[str]            =						output_hidden_size or hidden_size

							# SequenceClassification-specific parameter. Feel free to ignore for other classes.
							UpperCAmelCase_    :      int            =						classifier_proj_size

							# XVector-specific parameters. Feel free to ignore for other classes.
							UpperCAmelCase_    :      Dict            =						list(_UpperCamelCase   )
							UpperCAmelCase_    :      Optional[Any]            =						list(_UpperCamelCase   )
							UpperCAmelCase_    :      Union[str, Any]            =						list(_UpperCamelCase   )
							UpperCAmelCase_    :      int            =						xvector_output_dim



		@property
		def 					__UpperCAmelCase			(							self   )	->							str:
							return math.prod(self.conv_stride   )













'''simple docstring'''




from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


lowercase__    :      int						=    logging.get_logger(__name__)

lowercase__    :      int						=    {
    '''andreasmadsen/efficient_mlm_m0.40''': (
        '''https://huggingface.co/andreasmadsen/efficient_mlm_m0.40/resolve/main/config.json'''
    ),
}


class  SCREAMING_SNAKE_CASE    (a__							):
     lowerCAmelCase					=       '''roberta-prelayernorm'''


     def __init__(						self						,	_UpperCAmelCase=5_0265						,	_UpperCAmelCase=768						,	_UpperCAmelCase=12						,	_UpperCAmelCase=12						,	_UpperCAmelCase=3072						,	_UpperCAmelCase="gelu"						,	_UpperCAmelCase=0.1						,	_UpperCAmelCase=0.1						,	_UpperCAmelCase=512						,	_UpperCAmelCase=2						,	_UpperCAmelCase=0.02						,	_UpperCAmelCase=1e-1_2						,	_UpperCAmelCase=1						,	_UpperCAmelCase=0						,	_UpperCAmelCase=2						,	_UpperCAmelCase="absolute"						,	_UpperCAmelCase=True						,	_UpperCAmelCase=None						,	**_UpperCAmelCase						,	):

          '''simple docstring'''






          super().__init__(pad_token_id=_UpperCAmelCase						,	bos_token_id=_UpperCAmelCase						,	eos_token_id=_UpperCAmelCase						,	**_UpperCAmelCase)

          __A						: Optional[int]      =       vocab_size
          __A						: List[Any]      =       hidden_size
          __A						: Optional[int]      =       num_hidden_layers
          __A						: Optional[Any]      =       num_attention_heads
          __A						: List[str]      =       hidden_act
          __A						: Dict      =       intermediate_size
          __A						: Optional[int]      =       hidden_dropout_prob
          __A						: Optional[Any]      =       attention_probs_dropout_prob
          __A						: Tuple      =       max_position_embeddings
          __A						: Union[str, Any]      =       type_vocab_size
          __A						: Any      =       initializer_range
          __A						: str      =       layer_norm_eps
          __A						: int      =       position_embedding_type
          __A						: Optional[Any]      =       use_cache
          __A						: Any      =       classifier_dropout




class  SCREAMING_SNAKE_CASE    (a__							):


     @property
     def 							SCREAMING_SNAKE_CASE  (						self):

          '''simple docstring'''






          if self.task == "multiple-choice":
               __A						: Dict      =       {0: 'batch', 1: 'choice', 2: 'sequence'}
          else:
               __A						: Union[str, Any]      =       {0: 'batch', 1: 'sequence'}
          return OrderedDict(
              [
                  ('input_ids', dynamic_axis),
                  ('attention_mask', dynamic_axis),
              ])