

import functools
import operator

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


_SCREAMING_SNAKE_CASE					:  Union[str, Any]             =      logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE					:  List[str]             =      {
    '''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 	UpperCAmelCase__		(	A__	):






  """simple docstring"""


  a									= "sew"






  def __init__(							self						:		Optional[int]     ,       __lowerCamelCase						:		Any=32     ,       __lowerCamelCase						:		Union[str, Any]=768     ,       __lowerCamelCase						:		Union[str, Any]=12     ,       __lowerCamelCase						:		Tuple=12     ,       __lowerCamelCase						:		List[str]=3072     ,       __lowerCamelCase						:		List[Any]=2     ,       __lowerCamelCase						:		List[str]="gelu"     ,       __lowerCamelCase						:		str=0.1     ,       __lowerCamelCase						:		Any=0.1     ,       __lowerCamelCase						:		Union[str, Any]=0.1     ,       __lowerCamelCase						:		Optional[int]=0.0     ,       __lowerCamelCase						:		Optional[Any]=0.1     ,       __lowerCamelCase						:		Optional[Any]=0.1     ,       __lowerCamelCase						:		Dict=0.02     ,       __lowerCamelCase						:		Dict=1e-5     ,       __lowerCamelCase						:		Optional[Any]="group"     ,       __lowerCamelCase						:		List[Any]="gelu"     ,       __lowerCamelCase						:		Optional[Any]=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)     ,       __lowerCamelCase						:		Dict=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)     ,       __lowerCamelCase						:		List[str]=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)     ,       __lowerCamelCase						:		Dict=False     ,       __lowerCamelCase						:		int=128     ,       __lowerCamelCase						:		Optional[int]=16     ,       __lowerCamelCase						:		Optional[int]=True     ,       __lowerCamelCase						:		Optional[Any]=0.05     ,       __lowerCamelCase						:		List[str]=10     ,       __lowerCamelCase						:		Optional[int]=2     ,       __lowerCamelCase						:		Tuple=0.0     ,       __lowerCamelCase						:		List[str]=10     ,       __lowerCamelCase						:		List[Any]=0     ,       __lowerCamelCase						:		List[Any]="mean"     ,       __lowerCamelCase						:		str=False     ,       __lowerCamelCase						:		Tuple=False     ,       __lowerCamelCase						:		str=256     ,       __lowerCamelCase						:		Optional[int]=0     ,       __lowerCamelCase						:		Optional[int]=1     ,       __lowerCamelCase						:		Union[str, Any]=2     ,       **__lowerCamelCase						:		Any     ,       )		->							str:
       super().__init__(**__lowerCamelCase     ,       pad_token_id=__lowerCamelCase     ,       bos_token_id=__lowerCamelCase     ,       eos_token_id=__lowerCamelCase )
       SCREAMING_SNAKE_CASE__   =   hidden_size
       SCREAMING_SNAKE_CASE__   =   feat_extract_norm
       SCREAMING_SNAKE_CASE__   =   feat_extract_activation
       SCREAMING_SNAKE_CASE__   =   list(__lowerCamelCase )
       SCREAMING_SNAKE_CASE__   =   list(__lowerCamelCase )
       SCREAMING_SNAKE_CASE__   =   list(__lowerCamelCase )
       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__   =   squeeze_factor
       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__   =   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
       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

       # ctc loss
       SCREAMING_SNAKE_CASE__   =   ctc_loss_reduction
       SCREAMING_SNAKE_CASE__   =   ctc_zero_infinity

       # sequence classification
       SCREAMING_SNAKE_CASE__   =   use_weighted_layer_sum
       SCREAMING_SNAKE_CASE__   =   classifier_proj_size







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





def     UpperCAmelCase_       (						_A    ):





     '''simple docstring'''




     if divisor % 5 == 0 or divisor % 2 == 0:
          return 0
     SCREAMING_SNAKE_CASE__   =   1
     SCREAMING_SNAKE_CASE__   =   1
     while repunit:
          SCREAMING_SNAKE_CASE__   =   (10 * repunit + 1) % divisor
          repunit_index += 1
     return repunit_index
def     UpperCAmelCase_       (						_A = 1_00_00_00    ):





     '''simple docstring'''




     SCREAMING_SNAKE_CASE__   =   limit - 1
     if divisor % 2 == 0:
          divisor += 1
     while least_divisible_repunit(_A    ) <= limit:
          divisor += 2
     return divisor


if __name__ == "__main__":
       print(F"{solution() = }")


