



'''simple docstring'''





import functools
import operator

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


SCREAMING_SNAKE_CASE__          =  logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__          =  {
    "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 					snake_case			(UpperCamelCase ):
       lowerCAmelCase__	:Dict     =       "sew"



       def __init__(					self  ,UpperCAmelCase_=32  ,UpperCAmelCase_=768  ,UpperCAmelCase_=12  ,UpperCAmelCase_=12  ,UpperCAmelCase_=3_072  ,UpperCAmelCase_=2  ,UpperCAmelCase_="gelu"  ,UpperCAmelCase_=0.1  ,UpperCAmelCase_=0.1  ,UpperCAmelCase_=0.1  ,UpperCAmelCase_=0.0  ,UpperCAmelCase_=0.1  ,UpperCAmelCase_=0.1  ,UpperCAmelCase_=0.02  ,UpperCAmelCase_=1E-5  ,UpperCAmelCase_="group"  ,UpperCAmelCase_="gelu"  ,UpperCAmelCase_=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)  ,UpperCAmelCase_=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)  ,UpperCAmelCase_=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)  ,UpperCAmelCase_=False  ,UpperCAmelCase_=128  ,UpperCAmelCase_=16  ,UpperCAmelCase_=True  ,UpperCAmelCase_=0.05  ,UpperCAmelCase_=10  ,UpperCAmelCase_=2  ,UpperCAmelCase_=0.0  ,UpperCAmelCase_=10  ,UpperCAmelCase_=0  ,UpperCAmelCase_="mean"  ,UpperCAmelCase_=False  ,UpperCAmelCase_=False  ,UpperCAmelCase_=256  ,UpperCAmelCase_=0  ,UpperCAmelCase_=1  ,UpperCAmelCase_=2  ,**UpperCAmelCase_  ,)	->				Dict:
           super().__init__(**UpperCAmelCase_  ,pad_token_id=UpperCAmelCase_  ,bos_token_id=UpperCAmelCase_  ,eos_token_id=UpperCAmelCase_   )
           lowercase__									=    hidden_size
           lowercase__									=    feat_extract_norm
           lowercase__									=    feat_extract_activation
           lowercase__									=    list(UpperCAmelCase_   )
           lowercase__									=    list(UpperCAmelCase_   )
           lowercase__									=    list(UpperCAmelCase_   )
           lowercase__									=    conv_bias
           lowercase__									=    num_conv_pos_embeddings
           lowercase__									=    num_conv_pos_embedding_groups
           lowercase__									=    len(self.conv_dim   )
           lowercase__									=    num_hidden_layers
           lowercase__									=    intermediate_size
           lowercase__									=    squeeze_factor
           lowercase__									=    hidden_act
           lowercase__									=    num_attention_heads
           lowercase__									=    hidden_dropout
           lowercase__									=    attention_dropout
           lowercase__									=    activation_dropout
           lowercase__									=    feat_proj_dropout
           lowercase__									=    final_dropout
           lowercase__									=    layerdrop
           lowercase__									=    layer_norm_eps
           lowercase__									=    initializer_range
           lowercase__									=    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
           lowercase__									=    apply_spec_augment
           lowercase__									=    mask_time_prob
           lowercase__									=    mask_time_length
           lowercase__									=    mask_time_min_masks
           lowercase__									=    mask_feature_prob
           lowercase__									=    mask_feature_length
           lowercase__									=    mask_feature_min_masks

           # ctc loss
           lowercase__									=    ctc_loss_reduction
           lowercase__									=    ctc_zero_infinity

           # sequence classification
           lowercase__									=    use_weighted_layer_sum
           lowercase__									=    classifier_proj_size







       @property
       def 				_a   (					self   )	->				List[str]:
           return functools.reduce(operator.mul  ,self.conv_stride  ,1   )









'''simple docstring'''





from __future__ import annotations




def 							lowerCamelCase	(					_snake_case	:    list[int]							):





    '''simple docstring'''


    return len(set(_snake_case							)							) == len(_snake_case							)


if __name__ == "__main__":
 import doctest

 doctest.testmod()




