


import functools
import operator

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


snake_case__      			=    logging.get_logger(__name__)

snake_case__      			=    {
    '''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        lowerCAmelCase_			(							SCREAMING_SNAKE_CASE_):
						lowerCamelCase_    =  "sew-d"




						def __init__(						self    : Any ,  __A    : Dict=32 ,  __A    : List[str]=768 ,  __A    : int=12 ,  __A    : int=12 ,  __A    : Optional[Any]=3072 ,  __A    : List[Any]=2 ,  __A    : Dict=512 ,  __A    : int=256 ,  __A    : List[Any]=True ,  __A    : Optional[int]=True ,  __A    : Optional[Any]=("p2c", "c2p") ,  __A    : Optional[int]="layer_norm" ,  __A    : Any="gelu_python" ,  __A    : Optional[Any]=0.1 ,  __A    : str=0.1 ,  __A    : Union[str, Any]=0.1 ,  __A    : List[str]=0.0 ,  __A    : Optional[Any]=0.1 ,  __A    : Optional[Any]=0.02 ,  __A    : Dict=1E-7 ,  __A    : Dict=1E-5 ,  __A    : int="group" ,  __A    : Dict="gelu" ,  __A    : Optional[Any]=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512) ,  __A    : List[Any]=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1) ,  __A    : Optional[int]=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1) ,  __A    : Any=False ,  __A    : str=128 ,  __A    : List[Any]=16 ,  __A    : Any=True ,  __A    : List[Any]=0.05 ,  __A    : Optional[Any]=10 ,  __A    : List[Any]=2 ,  __A    : Optional[Any]=0.0 ,  __A    : Dict=10 ,  __A    : Optional[Any]=0 ,  __A    : Optional[int]="mean" ,  __A    : Dict=False ,  __A    : Optional[int]=False ,  __A    : Tuple=256 ,  __A    : Dict=0 ,  __A    : Any=1 ,  __A    : Optional[Any]=2 ,  **__A    : Any ,  )   ->Dict:






									"""simple docstring"""






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

									# ctc loss
									a__			:str    	=     ctc_loss_reduction
									a__			:List[Any]    	=     ctc_zero_infinity

									# sequence classification
									a__			:Optional[int]    	=     use_weighted_layer_sum
									a__			:Optional[int]    	=     classifier_proj_size






						@property
						def 			_snake_case       (						self    : Union[str, Any]    )   ->Tuple:






									"""simple docstring"""






									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


SCREAMING_SNAKE_CASE_            =    logging.get_logger(__name__)

SCREAMING_SNAKE_CASE_            =    {
    '''kssteven/ibert-roberta-base''': '''https://huggingface.co/kssteven/ibert-roberta-base/resolve/main/config.json''',
    '''kssteven/ibert-roberta-large''': '''https://huggingface.co/kssteven/ibert-roberta-large/resolve/main/config.json''',
    '''kssteven/ibert-roberta-large-mnli''': (
        '''https://huggingface.co/kssteven/ibert-roberta-large-mnli/resolve/main/config.json'''
    ),
}
class   _UpperCAmelCase				(		SCREAMING_SNAKE_CASE_				):
      __SCREAMING_SNAKE_CASE :				Tuple				   =						"ibert"




      def __init__(				self ,							lowercase_=3_0_5_2_2 ,							lowercase_=7_6_8 ,							lowercase_=1_2 ,							lowercase_=1_2 ,							lowercase_=3_0_7_2 ,							lowercase_="gelu" ,							lowercase_=0.1 ,							lowercase_=0.1 ,							lowercase_=5_1_2 ,							lowercase_=2 ,							lowercase_=0.0_2 ,							lowercase_=1E-12 ,							lowercase_=1 ,							lowercase_=0 ,							lowercase_=2 ,							lowercase_="absolute" ,							lowercase_=False ,							lowercase_="none" ,							**lowercase_ ,							)    ->       Optional[int]:
          super().__init__(pad_token_id=lowercase_ ,							bos_token_id=lowercase_ ,							eos_token_id=lowercase_ ,							**lowercase_				)

          UpperCAmelCase          =       vocab_size
          UpperCAmelCase          =       hidden_size
          UpperCAmelCase          =       num_hidden_layers
          UpperCAmelCase          =       num_attention_heads
          UpperCAmelCase          =       hidden_act
          UpperCAmelCase          =       intermediate_size
          UpperCAmelCase          =       hidden_dropout_prob
          UpperCAmelCase          =       attention_probs_dropout_prob
          UpperCAmelCase          =       max_position_embeddings
          UpperCAmelCase          =       type_vocab_size
          UpperCAmelCase          =       initializer_range
          UpperCAmelCase          =       layer_norm_eps
          UpperCAmelCase          =       position_embedding_type
          UpperCAmelCase          =       quant_mode
          UpperCAmelCase          =       force_dequant

class   _UpperCAmelCase				(		SCREAMING_SNAKE_CASE_				):




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



