



'''simple docstring'''





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        lowerCAmelCase_(				SCREAMING_SNAKE_CASE_     ):
  '''simple docstring'''




  __lowercase							:      Tuple				=      '''unispeech'''




  def __init__(    self  ,__UpperCAmelCase=32  ,__UpperCAmelCase=768  ,__UpperCAmelCase=12  ,__UpperCAmelCase=12  ,__UpperCAmelCase=3072  ,__UpperCAmelCase="gelu"  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase=0.0  ,__UpperCAmelCase=0.0  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase=0.0_2  ,__UpperCAmelCase=1E-5  ,__UpperCAmelCase="group"  ,__UpperCAmelCase="gelu"  ,__UpperCAmelCase=(512, 512, 512, 512, 512, 512, 512)  ,__UpperCAmelCase=(5, 2, 2, 2, 2, 2, 2)  ,__UpperCAmelCase=(10, 3, 3, 3, 3, 2, 2)  ,__UpperCAmelCase=False  ,__UpperCAmelCase=128  ,__UpperCAmelCase=16  ,__UpperCAmelCase=False  ,__UpperCAmelCase=True  ,__UpperCAmelCase=0.0_5  ,__UpperCAmelCase=10  ,__UpperCAmelCase=2  ,__UpperCAmelCase=0.0  ,__UpperCAmelCase=10  ,__UpperCAmelCase=0  ,__UpperCAmelCase=320  ,__UpperCAmelCase=2  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase=100  ,__UpperCAmelCase=256  ,__UpperCAmelCase=256  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase="mean"  ,__UpperCAmelCase=False  ,__UpperCAmelCase=False  ,__UpperCAmelCase=256  ,__UpperCAmelCase=80  ,__UpperCAmelCase=0  ,__UpperCAmelCase=1  ,__UpperCAmelCase=2  ,__UpperCAmelCase=0.5  ,**__UpperCAmelCase  ,)    ->		List[Any]:
      super().__init__(**__UpperCAmelCase  ,pad_token_id=__UpperCAmelCase  ,bos_token_id=__UpperCAmelCase  ,eos_token_id=__UpperCAmelCase      )
      lowerCAmelCase__ :  int							      =					hidden_size
      lowerCAmelCase__ :  Optional[int]							      =					feat_extract_norm
      lowerCAmelCase__ :  Tuple							      =					feat_extract_activation
      lowerCAmelCase__ :  Optional[int]							      =					list(__UpperCAmelCase      )
      lowerCAmelCase__ :  Any							      =					list(__UpperCAmelCase      )
      lowerCAmelCase__ :  str							      =					list(__UpperCAmelCase      )
      lowerCAmelCase__ :  Dict							      =					conv_bias
      lowerCAmelCase__ :  Optional[int]							      =					num_conv_pos_embeddings
      lowerCAmelCase__ :  Optional[int]							      =					num_conv_pos_embedding_groups
      lowerCAmelCase__ :  int							      =					len(self.conv_dim      )
      lowerCAmelCase__ :  str							      =					num_hidden_layers
      lowerCAmelCase__ :  Optional[int]							      =					intermediate_size
      lowerCAmelCase__ :  Optional[int]							      =					hidden_act
      lowerCAmelCase__ :  Optional[int]							      =					num_attention_heads
      lowerCAmelCase__ :  List[str]							      =					hidden_dropout
      lowerCAmelCase__ :  Tuple							      =					attention_dropout
      lowerCAmelCase__ :  Union[str, Any]							      =					activation_dropout
      lowerCAmelCase__ :  List[Any]							      =					feat_proj_dropout
      lowerCAmelCase__ :  Optional[Any]							      =					final_dropout
      lowerCAmelCase__ :  Optional[Any]							      =					layerdrop
      lowerCAmelCase__ :  Optional[Any]							      =					layer_norm_eps
      lowerCAmelCase__ :  Optional[int]							      =					initializer_range
      lowerCAmelCase__ :  str							      =					num_ctc_classes
      lowerCAmelCase__ :  Union[str, Any]							      =					vocab_size
      lowerCAmelCase__ :  Optional[int]							      =					do_stable_layer_norm
      lowerCAmelCase__ :  Tuple							      =					use_weighted_layer_sum
      lowerCAmelCase__ :  Tuple							      =					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
      lowerCAmelCase__ :  Any							      =					apply_spec_augment
      lowerCAmelCase__ :  Dict							      =					mask_time_prob
      lowerCAmelCase__ :  Dict							      =					mask_time_length
      lowerCAmelCase__ :  Union[str, Any]							      =					mask_time_min_masks
      lowerCAmelCase__ :  Optional[Any]							      =					mask_feature_prob
      lowerCAmelCase__ :  List[str]							      =					mask_feature_length
      lowerCAmelCase__ :  Optional[Any]							      =					mask_feature_min_masks

      # parameters for pretraining with codevector quantized representations
      lowerCAmelCase__ :  str							      =					num_codevectors_per_group
      lowerCAmelCase__ :  Optional[int]							      =					num_codevector_groups
      lowerCAmelCase__ :  Dict							      =					contrastive_logits_temperature
      lowerCAmelCase__ :  Tuple							      =					feat_quantizer_dropout
      lowerCAmelCase__ :  Tuple							      =					num_negatives
      lowerCAmelCase__ :  Union[str, Any]							      =					codevector_dim
      lowerCAmelCase__ :  str							      =					proj_codevector_dim
      lowerCAmelCase__ :  Optional[Any]							      =					diversity_loss_weight

      # ctc loss
      lowerCAmelCase__ :  str							      =					ctc_loss_reduction
      lowerCAmelCase__ :  Tuple							      =					ctc_zero_infinity

      # pretraining loss
      lowerCAmelCase__ :  Union[str, Any]							      =					replace_prob






  @property
  def 							UpperCAmelCase_	(    self      )    ->		Any:
      return functools.reduce(operator.mul  ,self.conv_stride  ,1      )







'''simple docstring'''





from collections import OrderedDict
from typing import Mapping

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


_lowerCAmelCase      						=	logging.get_logger(__name__)

_lowerCAmelCase      						=	{
    '''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_(				SCREAMING_SNAKE_CASE_     ):
  '''simple docstring'''




  __lowercase							:      int				=      '''xlm-roberta-xl'''




  def __init__(    self  ,__UpperCAmelCase=25_0880  ,__UpperCAmelCase=2560  ,__UpperCAmelCase=36  ,__UpperCAmelCase=32  ,__UpperCAmelCase=1_0240  ,__UpperCAmelCase="gelu"  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase=0.1  ,__UpperCAmelCase=514  ,__UpperCAmelCase=1  ,__UpperCAmelCase=0.0_2  ,__UpperCAmelCase=1E-05  ,__UpperCAmelCase=1  ,__UpperCAmelCase=0  ,__UpperCAmelCase=2  ,__UpperCAmelCase="absolute"  ,__UpperCAmelCase=True  ,__UpperCAmelCase=None  ,**__UpperCAmelCase  ,)    ->		str:
      super().__init__(pad_token_id=__UpperCAmelCase  ,bos_token_id=__UpperCAmelCase  ,eos_token_id=__UpperCAmelCase  ,**__UpperCAmelCase      )
      lowerCAmelCase__ :  List[Any]							      =					vocab_size
      lowerCAmelCase__ :  int							      =					hidden_size
      lowerCAmelCase__ :  int							      =					num_hidden_layers
      lowerCAmelCase__ :  str							      =					num_attention_heads
      lowerCAmelCase__ :  int							      =					hidden_act
      lowerCAmelCase__ :  Dict							      =					intermediate_size
      lowerCAmelCase__ :  List[Any]							      =					hidden_dropout_prob
      lowerCAmelCase__ :  str							      =					attention_probs_dropout_prob
      lowerCAmelCase__ :  Optional[int]							      =					max_position_embeddings
      lowerCAmelCase__ :  List[str]							      =					type_vocab_size
      lowerCAmelCase__ :  List[Any]							      =					initializer_range
      lowerCAmelCase__ :  Tuple							      =					layer_norm_eps
      lowerCAmelCase__ :  int							      =					position_embedding_type
      lowerCAmelCase__ :  Optional[Any]							      =					use_cache
      lowerCAmelCase__ :  Optional[Any]							      =					classifier_dropout







class        lowerCAmelCase_(				SCREAMING_SNAKE_CASE_     ):
  '''simple docstring'''




  @property
  def 							UpperCAmelCase_	(    self      )    ->		Mapping[str, Mapping[int, str]]:
      if self.task == "multiple-choice":
          lowerCAmelCase__ :  Dict							      =					{0: """batch""", 1: """choice""", 2: """sequence"""}
      else:
          lowerCAmelCase__ :  Any							      =					{0: """batch""", 1: """sequence"""}
      return OrderedDict(
          [
              ("""input_ids""", dynamic_axis),
              ("""attention_mask""", dynamic_axis),
          ]      )


