






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   )













from collections import OrderedDict
from typing import Mapping

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


A    :					Union[str, Any] =      logging.get_logger(__name__)

A    :					int =      {
    '''xlm-roberta-base''': '''https://huggingface.co/xlm-roberta-base/resolve/main/config.json''',
    '''xlm-roberta-large''': '''https://huggingface.co/xlm-roberta-large/resolve/main/config.json''',
    '''xlm-roberta-large-finetuned-conll02-dutch''': (
        '''https://huggingface.co/xlm-roberta-large-finetuned-conll02-dutch/resolve/main/config.json'''
    ),
    '''xlm-roberta-large-finetuned-conll02-spanish''': (
        '''https://huggingface.co/xlm-roberta-large-finetuned-conll02-spanish/resolve/main/config.json'''
    ),
    '''xlm-roberta-large-finetuned-conll03-english''': (
        '''https://huggingface.co/xlm-roberta-large-finetuned-conll03-english/resolve/main/config.json'''
    ),
    '''xlm-roberta-large-finetuned-conll03-german''': (
        '''https://huggingface.co/xlm-roberta-large-finetuned-conll03-german/resolve/main/config.json'''
    ),
}


class   A			(SCREAMING_SNAKE_CASE    ):
			'''simple docstring'''




			__lowerCamelCase	:       Any							=    '''xlm-roberta'''






			def __init__(			self   :    Optional[Any]							,	__lowerCAmelCase   :    List[Any]=3_05_22							,	__lowerCAmelCase   :    int=7_68							,	__lowerCAmelCase   :    Tuple=12							,	__lowerCAmelCase   :    str=12							,	__lowerCAmelCase   :    Union[str, Any]=30_72							,	__lowerCAmelCase   :    Union[str, Any]="gelu"							,	__lowerCAmelCase   :    Optional[int]=0.1							,	__lowerCAmelCase   :    Dict=0.1							,	__lowerCAmelCase   :    List[str]=5_12							,	__lowerCAmelCase   :    Tuple=2							,	__lowerCAmelCase   :    Dict=0.0_2							,	__lowerCAmelCase   :    List[str]=1e-12							,	__lowerCAmelCase   :    Union[str, Any]=1							,	__lowerCAmelCase   :    str=0							,	__lowerCAmelCase   :    Optional[int]=2							,	__lowerCAmelCase   :    Tuple="absolute"							,	__lowerCAmelCase   :    Any=True							,	__lowerCAmelCase   :    Any=None							,	**__lowerCAmelCase   :    str							,	)	->	Optional[Any]:







					"""simple docstring"""






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

					A__        =   vocab_size
					A__        =   hidden_size
					A__        =   num_hidden_layers
					A__        =   num_attention_heads
					A__        =   hidden_act
					A__        =   intermediate_size
					A__        =   hidden_dropout_prob
					A__        =   attention_probs_dropout_prob
					A__        =   max_position_embeddings
					A__        =   type_vocab_size
					A__        =   initializer_range
					A__        =   layer_norm_eps
					A__        =   position_embedding_type
					A__        =   use_cache
					A__        =   classifier_dropout


class   A			(SCREAMING_SNAKE_CASE    ):
			'''simple docstring'''




			@property
			def    a_       (			self   :    int   )	->	Mapping[str, Mapping[int, str]]:







					"""simple docstring"""






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



