


'''simple docstring'''




from collections import OrderedDict
from typing import Mapping

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


UpperCAmelCase_      :		Optional[Any]          =		logging.get_logger(__name__)

UpperCAmelCase_      :		Dict          =		{
    "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 					a			(				snake_case__  ):
 '''simple docstring'''




 __lowerCAmelCase						: List[str]							  =		"""xlm-roberta-xl"""




 def __init__(    self		,      lowerCamelCase_=2_5_0_8_8_0		,      lowerCamelCase_=2_5_6_0		,      lowerCamelCase_=3_6		,      lowerCamelCase_=3_2		,      lowerCamelCase_=1_0_2_4_0		,      lowerCamelCase_="gelu"		,      lowerCamelCase_=0.1		,      lowerCamelCase_=0.1		,      lowerCamelCase_=5_1_4		,      lowerCamelCase_=1		,      lowerCamelCase_=0.02		,      lowerCamelCase_=1e-05		,      lowerCamelCase_=1		,      lowerCamelCase_=0		,      lowerCamelCase_=2		,      lowerCamelCase_="absolute"		,      lowerCamelCase_=True		,      lowerCamelCase_=None		,      **lowerCamelCase_		,      )      ->    Dict:
    super().__init__(pad_token_id=lowerCamelCase_		,      bos_token_id=lowerCamelCase_		,      eos_token_id=lowerCamelCase_		,      **lowerCamelCase_      )
    _a					:  List[str]						=  vocab_size
    _a					:  Optional[Any]						=  hidden_size
    _a					:  Dict						=  num_hidden_layers
    _a					:  List[str]						=  num_attention_heads
    _a					:  Tuple						=  hidden_act
    _a					:  Union[str, Any]						=  intermediate_size
    _a					:  Any						=  hidden_dropout_prob
    _a					:  Optional[Any]						=  attention_probs_dropout_prob
    _a					:  Optional[Any]						=  max_position_embeddings
    _a					:  int						=  type_vocab_size
    _a					:  Optional[Any]						=  initializer_range
    _a					:  str						=  layer_norm_eps
    _a					:  Any						=  position_embedding_type
    _a					:  Dict						=  use_cache
    _a					:  str						=  classifier_dropout







class 					a			(				snake_case__  ):
 '''simple docstring'''




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






'''simple docstring'''




import functools
import operator

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


UpperCAmelCase_      :		Any          =		logging.get_logger(__name__)

UpperCAmelCase_      :		Any          =		{
    "asapp/sew-tiny-100k": "https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json",
    # See all SEW models at https://huggingface.co/models?filter=sew
}







class 					a			(				snake_case__  ):
 '''simple docstring'''




 __lowerCAmelCase						: Tuple							  =		"""sew"""




 def __init__(    self		,      lowerCamelCase_=3_2		,      lowerCamelCase_=7_6_8		,      lowerCamelCase_=1_2		,      lowerCamelCase_=1_2		,      lowerCamelCase_=3_0_7_2		,      lowerCamelCase_=2		,      lowerCamelCase_="gelu"		,      lowerCamelCase_=0.1		,      lowerCamelCase_=0.1		,      lowerCamelCase_=0.1		,      lowerCamelCase_=0.0		,      lowerCamelCase_=0.1		,      lowerCamelCase_=0.1		,      lowerCamelCase_=0.02		,      lowerCamelCase_=1e-5		,      lowerCamelCase_="group"		,      lowerCamelCase_="gelu"		,      lowerCamelCase_=(6_4, 1_2_8, 1_2_8, 1_2_8, 1_2_8, 2_5_6, 2_5_6, 2_5_6, 2_5_6, 5_1_2, 5_1_2, 5_1_2, 5_1_2)		,      lowerCamelCase_=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)		,      lowerCamelCase_=(1_0, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)		,      lowerCamelCase_=False		,      lowerCamelCase_=1_2_8		,      lowerCamelCase_=1_6		,      lowerCamelCase_=True		,      lowerCamelCase_=0.05		,      lowerCamelCase_=1_0		,      lowerCamelCase_=2		,      lowerCamelCase_=0.0		,      lowerCamelCase_=1_0		,      lowerCamelCase_=0		,      lowerCamelCase_="mean"		,      lowerCamelCase_=False		,      lowerCamelCase_=False		,      lowerCamelCase_=2_5_6		,      lowerCamelCase_=0		,      lowerCamelCase_=1		,      lowerCamelCase_=2		,      **lowerCamelCase_		,      )      ->    Tuple:
    super().__init__(**lowerCamelCase_		,      pad_token_id=lowerCamelCase_		,      bos_token_id=lowerCamelCase_		,      eos_token_id=lowerCamelCase_      )
    _a					:  Optional[int]						=  hidden_size
    _a					:  int						=  feat_extract_norm
    _a					:  Optional[int]						=  feat_extract_activation
    _a					:  str						=  list(lowerCamelCase_      )
    _a					:  Union[str, Any]						=  list(lowerCamelCase_      )
    _a					:  List[Any]						=  list(lowerCamelCase_      )
    _a					:  Union[str, Any]						=  conv_bias
    _a					:  Optional[int]						=  num_conv_pos_embeddings
    _a					:  Dict						=  num_conv_pos_embedding_groups
    _a					:  str						=  len(self.conv_dim      )
    _a					:  Any						=  num_hidden_layers
    _a					:  List[Any]						=  intermediate_size
    _a					:  Tuple						=  squeeze_factor
    _a					:  Tuple						=  hidden_act
    _a					:  Any						=  num_attention_heads
    _a					:  Optional[int]						=  hidden_dropout
    _a					:  List[str]						=  attention_dropout
    _a					:  Optional[Any]						=  activation_dropout
    _a					:  str						=  feat_proj_dropout
    _a					:  str						=  final_dropout
    _a					:  str						=  layerdrop
    _a					:  Optional[Any]						=  layer_norm_eps
    _a					:  Optional[Any]						=  initializer_range
    _a					:  Any						=  vocab_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)`,'
           F'''but is `len(config.conv_dim) = {len(self.conv_dim      )}`, `len(config.conv_stride)'''
           F'''= {len(self.conv_stride      )}`, `len(config.conv_kernel) = {len(self.conv_kernel      )}`.'''      )

    # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
    _a					:  str						=  apply_spec_augment
    _a					:  List[Any]						=  mask_time_prob
    _a					:  Optional[Any]						=  mask_time_length
    _a					:  Union[str, Any]						=  mask_time_min_masks
    _a					:  List[str]						=  mask_feature_prob
    _a					:  List[str]						=  mask_feature_length
    _a					:  str						=  mask_feature_min_masks

    # ctc loss
    _a					:  Any						=  ctc_loss_reduction
    _a					:  Optional[Any]						=  ctc_zero_infinity

    # sequence classification
    _a					:  List[Any]						=  use_weighted_layer_sum
    _a					:  Tuple						=  classifier_proj_size




 @property
 def   __UpperCamelCase   (    self      )      ->    Optional[int]:
    return functools.reduce(operator.mul		,      self.conv_stride		,      1      )


