





import functools
import operator

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


_lowerCamelCase 					=      logging.get_logger(__name__)

_lowerCamelCase 					=      {
    'microsoft/unispeech-large-1500h-cv': (
        'https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json'
    ),
    # See all UniSpeech models at https://huggingface.co/models?filter=unispeech
}




class 	UpperCamelCase_							(  UpperCamelCase__     ):
							lowerCamelCase_							     =       "unispeech"


							def __init__(				self     :Tuple				,					__A     :str=32				,					__A     :Optional[int]=768				,					__A     :Optional[int]=12				,					__A     :Any=12				,					__A     :List[str]=3072				,					__A     :Optional[int]="gelu"				,					__A     :Dict=0.1				,					__A     :Union[str, Any]=0.1				,					__A     :Tuple=0.1				,					__A     :Union[str, Any]=0.0				,					__A     :Any=0.0				,					__A     :List[Any]=0.1				,					__A     :Any=0.1				,					__A     :List[str]=0.0_2				,					__A     :Any=1E-5				,					__A     :Optional[int]="group"				,					__A     :Tuple="gelu"				,					__A     :Dict=(512, 512, 512, 512, 512, 512, 512)				,					__A     :Dict=(5, 2, 2, 2, 2, 2, 2)				,					__A     :List[Any]=(10, 3, 3, 3, 3, 2, 2)				,					__A     :List[Any]=False				,					__A     :int=128				,					__A     :int=16				,					__A     :Any=False				,					__A     :int=True				,					__A     :Tuple=0.0_5				,					__A     :Optional[int]=10				,					__A     :List[str]=2				,					__A     :Dict=0.0				,					__A     :Optional[Any]=10				,					__A     :Tuple=0				,					__A     :Tuple=320				,					__A     :Tuple=2				,					__A     :int=0.1				,					__A     :Optional[Any]=100				,					__A     :List[Any]=256				,					__A     :Optional[Any]=256				,					__A     :Optional[Any]=0.1				,					__A     :Tuple="mean"				,					__A     :int=False				,					__A     :int=False				,					__A     :Dict=256				,					__A     :Union[str, Any]=80				,					__A     :str=0				,					__A     :Any=1				,					__A     :str=2				,					__A     :Dict=0.5				,					**__A     :List[str]				,					) -> int:



									"""simple docstring"""



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

									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
									SCREAMING_SNAKE_CASE__								=   apply_spec_augment
									SCREAMING_SNAKE_CASE__								=   mask_time_prob
									SCREAMING_SNAKE_CASE__								=   mask_time_length
									SCREAMING_SNAKE_CASE__								=   mask_time_min_masks
									SCREAMING_SNAKE_CASE__								=   mask_feature_prob
									SCREAMING_SNAKE_CASE__								=   mask_feature_length
									SCREAMING_SNAKE_CASE__								=   mask_feature_min_masks

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

									# ctc loss
									SCREAMING_SNAKE_CASE__								=   ctc_loss_reduction
									SCREAMING_SNAKE_CASE__								=   ctc_zero_infinity

									# pretraining loss
									SCREAMING_SNAKE_CASE__								=   replace_prob


							@property
							def   _snake_case	(				self     :int		) -> int:



									"""simple docstring"""



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





from collections import OrderedDict
from typing import Mapping

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


__A								=       logging.get_logger(__name__)

__A								=       {
    "facebook/xlm-roberta-xl": "https://huggingface.co/facebook/xlm-roberta-xl/resolve/main/config.json",
    "facebook/xlm-roberta-xxl": "https://huggingface.co/facebook/xlm-roberta-xxl/resolve/main/config.json",
    # See all XLM-RoBERTa-XL models at https://huggingface.co/models?filter=xlm-roberta-xl
}







class        __lowerCAmelCase					(			__magic_name__					):

			"""simple docstring"""







			snake_case_  						=			'''xlm-roberta-xl'''


			def __init__( self     ,		lowerCamelCase__=250_880     ,		lowerCamelCase__=2_560     ,		lowerCamelCase__=36     ,		lowerCamelCase__=32     ,		lowerCamelCase__=10_240     ,		lowerCamelCase__="gelu"     ,		lowerCamelCase__=0.1     ,		lowerCamelCase__=0.1     ,		lowerCamelCase__=514     ,		lowerCamelCase__=1     ,		lowerCamelCase__=0.02     ,		lowerCamelCase__=1e-05     ,		lowerCamelCase__=1     ,		lowerCamelCase__=0     ,		lowerCamelCase__=2     ,		lowerCamelCase__="absolute"     ,		lowerCamelCase__=True     ,		lowerCamelCase__=None     ,		**lowerCamelCase__     ,		)       -> str:



							'''simple docstring'''
							super().__init__(pad_token_id=lowerCamelCase__     ,		bos_token_id=lowerCamelCase__     ,		eos_token_id=lowerCamelCase__     ,		**lowerCamelCase__				)
							__lowerCamelCase									=       vocab_size
							__lowerCamelCase									=       hidden_size
							__lowerCamelCase									=       num_hidden_layers
							__lowerCamelCase									=       num_attention_heads
							__lowerCamelCase									=       hidden_act
							__lowerCamelCase									=       intermediate_size
							__lowerCamelCase									=       hidden_dropout_prob
							__lowerCamelCase									=       attention_probs_dropout_prob
							__lowerCamelCase									=       max_position_embeddings
							__lowerCamelCase									=       type_vocab_size
							__lowerCamelCase									=       initializer_range
							__lowerCamelCase									=       layer_norm_eps
							__lowerCamelCase									=       position_embedding_type
							__lowerCamelCase									=       use_cache
							__lowerCamelCase									=       classifier_dropout







class        __lowerCAmelCase					(			__magic_name__					):

			"""simple docstring"""







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



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


