




"""simple docstring"""

import functools
import operator

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


a         =      logging.get_logger(__name__)

a         =      {
    '''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     lowercase_	(					__lowerCAmelCase							):



 '''simple docstring'''
 UpperCAmelCase   :					List[str]				  =     '''sew-d'''

 def __init__(			self	:	List[str]   ,							_UpperCAmelCase	:	Any=32   ,							_UpperCAmelCase	:	Optional[int]=768   ,							_UpperCAmelCase	:	Any=12   ,							_UpperCAmelCase	:	List[Any]=12   ,							_UpperCAmelCase	:	List[str]=3_072   ,							_UpperCAmelCase	:	List[Any]=2   ,							_UpperCAmelCase	:	List[Any]=512   ,							_UpperCAmelCase	:	Tuple=256   ,							_UpperCAmelCase	:	Any=True   ,							_UpperCAmelCase	:	Any=True   ,							_UpperCAmelCase	:	Any=("p2c", "c2p")   ,							_UpperCAmelCase	:	Any="layer_norm"   ,							_UpperCAmelCase	:	str="gelu_python"   ,							_UpperCAmelCase	:	str=0.1   ,							_UpperCAmelCase	:	Optional[Any]=0.1   ,							_UpperCAmelCase	:	Dict=0.1   ,							_UpperCAmelCase	:	Dict=0.0   ,							_UpperCAmelCase	:	Optional[int]=0.1   ,							_UpperCAmelCase	:	str=0.02   ,							_UpperCAmelCase	:	Optional[Any]=1E-7   ,							_UpperCAmelCase	:	List[Any]=1E-5   ,							_UpperCAmelCase	:	Optional[Any]="group"   ,							_UpperCAmelCase	:	int="gelu"   ,							_UpperCAmelCase	:	List[str]=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)   ,							_UpperCAmelCase	:	Dict=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)   ,							_UpperCAmelCase	:	Dict=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)   ,							_UpperCAmelCase	:	Tuple=False   ,							_UpperCAmelCase	:	Tuple=128   ,							_UpperCAmelCase	:	List[Any]=16   ,							_UpperCAmelCase	:	Union[str, Any]=True   ,							_UpperCAmelCase	:	Tuple=0.05   ,							_UpperCAmelCase	:	str=10   ,							_UpperCAmelCase	:	List[str]=2   ,							_UpperCAmelCase	:	int=0.0   ,							_UpperCAmelCase	:	str=10   ,							_UpperCAmelCase	:	Optional[Any]=0   ,							_UpperCAmelCase	:	Optional[Any]="mean"   ,							_UpperCAmelCase	:	int=False   ,							_UpperCAmelCase	:	int=False   ,							_UpperCAmelCase	:	List[Any]=256   ,							_UpperCAmelCase	:	Tuple=0   ,							_UpperCAmelCase	:	str=1   ,							_UpperCAmelCase	:	List[Any]=2   ,							**_UpperCAmelCase	:	List[Any]   ,							):
       super().__init__(**_UpperCAmelCase   ,							pad_token_id=_UpperCAmelCase   ,							bos_token_id=_UpperCAmelCase   ,							eos_token_id=_UpperCAmelCase		)
       _A        =       hidden_size
       _A        =       feat_extract_norm
       _A        =       feat_extract_activation
       _A        =       list(_UpperCAmelCase		)
       _A        =       list(_UpperCAmelCase		)
       _A        =       list(_UpperCAmelCase		)
       _A        =       conv_bias
       _A        =       num_conv_pos_embeddings
       _A        =       num_conv_pos_embedding_groups
       _A        =       len(self.conv_dim		)
       _A        =       num_hidden_layers
       _A        =       intermediate_size
       _A        =       squeeze_factor
       _A        =       max_position_embeddings
       _A        =       position_buckets
       _A        =       share_att_key
       _A        =       relative_attention
       _A        =       norm_rel_ebd
       _A        =       list(_UpperCAmelCase		)
       _A        =       hidden_act
       _A        =       num_attention_heads
       _A        =       hidden_dropout
       _A        =       attention_dropout
       _A        =       activation_dropout
       _A        =       feat_proj_dropout
       _A        =       final_dropout
       _A        =       layer_norm_eps
       _A        =       feature_layer_norm_eps
       _A        =       initializer_range
       _A        =       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        =       apply_spec_augment
       _A        =       mask_time_prob
       _A        =       mask_time_length
       _A        =       mask_time_min_masks
       _A        =       mask_feature_prob
       _A        =       mask_feature_length
       _A        =       mask_feature_min_masks

       # ctc loss
       _A        =       ctc_loss_reduction
       _A        =       ctc_zero_infinity

       # sequence classification
       _A        =       use_weighted_layer_sum
       _A        =       classifier_proj_size



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







"""simple docstring"""

import os

from huggingface_hub.constants import HUGGINGFACE_HUB_CACHE, hf_cache_home


a         =      HUGGINGFACE_HUB_CACHE


a         =      '''config.json'''
a         =      '''diffusion_pytorch_model.bin'''
a         =      '''diffusion_flax_model.msgpack'''
a         =      '''model.onnx'''
a         =      '''diffusion_pytorch_model.safetensors'''
a         =      '''weights.pb'''
a         =      '''https://huggingface.co'''
a         =      default_cache_path
a         =      '''diffusers_modules'''
a         =      os.getenv('''HF_MODULES_CACHE''', os.path.join(hf_cache_home, '''modules'''))
a         =      ['''fp16''', '''non-ema''']
a         =      '''.self_attn'''

