





import functools
import operator

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


__lowerCamelCase :  List[Any]										=  logging.get_logger(__name__)

__lowerCamelCase :  Optional[int]										=  {
    """asapp/sew-d-tiny-100k""": """https://huggingface.co/asapp/sew-d-tiny-100k/resolve/main/config.json""",
    # See all SEW-D models at https://huggingface.co/models?filter=sew-d
}



class       A__     ( __A    ):
      _UpperCAmelCase			:int							=     'sew-d'





      def __init__(				self ,							A_=32 ,							A_=768 ,							A_=12 ,							A_=12 ,							A_=3072 ,							A_=2 ,							A_=512 ,							A_=256 ,							A_=True ,							A_=True ,							A_=("p2c", "c2p") ,							A_="layer_norm" ,							A_="gelu_python" ,							A_=0.1 ,							A_=0.1 ,							A_=0.1 ,							A_=0.0 ,							A_=0.1 ,							A_=0.02 ,							A_=1e-7 ,							A_=1e-5 ,							A_="group" ,							A_="gelu" ,							A_=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512) ,							A_=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1) ,							A_=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1) ,							A_=False ,							A_=128 ,							A_=16 ,							A_=True ,							A_=0.05 ,							A_=10 ,							A_=2 ,							A_=0.0 ,							A_=10 ,							A_=0 ,							A_="mean" ,							A_=False ,							A_=False ,							A_=256 ,							A_=0 ,							A_=1 ,							A_=2 ,							**A_ ,							):
       '''simple docstring'''




       super().__init__(**A_ ,							pad_token_id=A_ ,							bos_token_id=A_ ,							eos_token_id=A_     )
       UpperCamelCase			:      Union[str, Any] 			=     hidden_size
       UpperCamelCase			:      Optional[Any] 			=     feat_extract_norm
       UpperCamelCase			:      Dict 			=     feat_extract_activation
       UpperCamelCase			:      Optional[Any] 			=     list(A_     )
       UpperCamelCase			:      Optional[int] 			=     list(A_     )
       UpperCamelCase			:      List[Any] 			=     list(A_     )
       UpperCamelCase			:      Dict 			=     conv_bias
       UpperCamelCase			:      Any 			=     num_conv_pos_embeddings
       UpperCamelCase			:      Tuple 			=     num_conv_pos_embedding_groups
       UpperCamelCase			:      List[Any] 			=     len(self.conv_dim     )
       UpperCamelCase			:      Any 			=     num_hidden_layers
       UpperCamelCase			:      List[Any] 			=     intermediate_size
       UpperCamelCase			:      Any 			=     squeeze_factor
       UpperCamelCase			:      Dict 			=     max_position_embeddings
       UpperCamelCase			:      Union[str, Any] 			=     position_buckets
       UpperCamelCase			:      List[Any] 			=     share_att_key
       UpperCamelCase			:      Optional[int] 			=     relative_attention
       UpperCamelCase			:      List[Any] 			=     norm_rel_ebd
       UpperCamelCase			:      List[str] 			=     list(A_     )
       UpperCamelCase			:      Optional[Any] 			=     hidden_act
       UpperCamelCase			:      Optional[int] 			=     num_attention_heads
       UpperCamelCase			:      int 			=     hidden_dropout
       UpperCamelCase			:      Optional[Any] 			=     attention_dropout
       UpperCamelCase			:      Optional[Any] 			=     activation_dropout
       UpperCamelCase			:      Union[str, Any] 			=     feat_proj_dropout
       UpperCamelCase			:      Union[str, Any] 			=     final_dropout
       UpperCamelCase			:      Dict 			=     layer_norm_eps
       UpperCamelCase			:      Tuple 			=     feature_layer_norm_eps
       UpperCamelCase			:      Optional[Any] 			=     initializer_range
       UpperCamelCase			:      Optional[int] 			=     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
       UpperCamelCase			:      str 			=     apply_spec_augment
       UpperCamelCase			:      str 			=     mask_time_prob
       UpperCamelCase			:      int 			=     mask_time_length
       UpperCamelCase			:      Tuple 			=     mask_time_min_masks
       UpperCamelCase			:      Dict 			=     mask_feature_prob
       UpperCamelCase			:      Any 			=     mask_feature_length
       UpperCamelCase			:      Dict 			=     mask_feature_min_masks

       # ctc loss
       UpperCamelCase			:      List[str] 			=     ctc_loss_reduction
       UpperCamelCase			:      Dict 			=     ctc_zero_infinity

       # sequence classification
       UpperCamelCase			:      int 			=     use_weighted_layer_sum
       UpperCamelCase			:      Dict 			=     classifier_proj_size





      @property
      def  __UpperCamelCase(				self     ):
       '''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


__lowerCamelCase :  Tuple										=  logging.get_logger(__name__)

__lowerCamelCase :  str										=  {
    """camembert-base""": """https://huggingface.co/camembert-base/resolve/main/config.json""",
    """umberto-commoncrawl-cased-v1""": (
        """https://huggingface.co/Musixmatch/umberto-commoncrawl-cased-v1/resolve/main/config.json"""
    ),
    """umberto-wikipedia-uncased-v1""": (
        """https://huggingface.co/Musixmatch/umberto-wikipedia-uncased-v1/resolve/main/config.json"""
    ),
}



class       A__     ( __snake_case    ):
      _UpperCAmelCase			:Union[str, Any]							=     'camembert'





      def __init__(				self ,							A_=3_0522 ,							A_=768 ,							A_=12 ,							A_=12 ,							A_=3072 ,							A_="gelu" ,							A_=0.1 ,							A_=0.1 ,							A_=512 ,							A_=2 ,							A_=0.02 ,							A_=1e-12 ,							A_=1 ,							A_=0 ,							A_=2 ,							A_="absolute" ,							A_=True ,							A_=None ,							**A_ ,							):
       '''simple docstring'''




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

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



class       A__     ( __snake_case    ):





      @property
      def  __UpperCamelCase(				self     ):
       '''simple docstring'''




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