



import functools
import operator

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


a_    :  int						  =		logging.get_logger(__name__)

a_    :  str						  =		{
    '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__	(    UpperCAmelCase_):
     """simple docstring"""



     _A      =      'sew-d'







     def __init__(self					,      __a=32					,      __a=7_68					,      __a=12					,      __a=12					,      __a=30_72					,      __a=2					,      __a=5_12					,      __a=2_56					,      __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, 1_28, 1_28, 1_28, 1_28, 2_56, 2_56, 2_56, 2_56, 5_12, 5_12, 5_12, 5_12)					,      __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=1_28					,      __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=2_56					,      __a=0					,      __a=1					,      __a=2					,      **__a					,      ):






           '''simple docstring'''



           super().__init__(**__a					,      pad_token_id=__a					,      bos_token_id=__a					,      eos_token_id=__a     )
           lowerCamelCase             =		hidden_size
           lowerCamelCase             =		feat_extract_norm
           lowerCamelCase             =		feat_extract_activation
           lowerCamelCase             =		list(__a     )
           lowerCamelCase             =		list(__a     )
           lowerCamelCase             =		list(__a     )
           lowerCamelCase             =		conv_bias
           lowerCamelCase             =		num_conv_pos_embeddings
           lowerCamelCase             =		num_conv_pos_embedding_groups
           lowerCamelCase             =		len(self.conv_dim     )
           lowerCamelCase             =		num_hidden_layers
           lowerCamelCase             =		intermediate_size
           lowerCamelCase             =		squeeze_factor
           lowerCamelCase             =		max_position_embeddings
           lowerCamelCase             =		position_buckets
           lowerCamelCase             =		share_att_key
           lowerCamelCase             =		relative_attention
           lowerCamelCase             =		norm_rel_ebd
           lowerCamelCase             =		list(__a     )
           lowerCamelCase             =		hidden_act
           lowerCamelCase             =		num_attention_heads
           lowerCamelCase             =		hidden_dropout
           lowerCamelCase             =		attention_dropout
           lowerCamelCase             =		activation_dropout
           lowerCamelCase             =		feat_proj_dropout
           lowerCamelCase             =		final_dropout
           lowerCamelCase             =		layer_norm_eps
           lowerCamelCase             =		feature_layer_norm_eps
           lowerCamelCase             =		initializer_range
           lowerCamelCase             =		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
           lowerCamelCase             =		apply_spec_augment
           lowerCamelCase             =		mask_time_prob
           lowerCamelCase             =		mask_time_length
           lowerCamelCase             =		mask_time_min_masks
           lowerCamelCase             =		mask_feature_prob
           lowerCamelCase             =		mask_feature_length
           lowerCamelCase             =		mask_feature_min_masks

           # ctc loss
           lowerCamelCase             =		ctc_loss_reduction
           lowerCamelCase             =		ctc_zero_infinity

           # sequence classification
           lowerCamelCase             =		use_weighted_layer_sum
           lowerCamelCase             =		classifier_proj_size







     @property
     def     _a   (self     ):






           '''simple docstring'''



           return functools.reduce(operator.mul					,      self.conv_stride					,      1     )




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_torch_available,
)


a_    :  Tuple						  =		{'configuration_unispeech': ['UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP', 'UniSpeechConfig']}

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     a_    :  Union[str, Any]						  =		[
         'UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST',
         'UniSpeechForCTC',
         'UniSpeechForPreTraining',
         'UniSpeechForSequenceClassification',
         'UniSpeechModel',
         'UniSpeechPreTrainedModel',
     ]

if TYPE_CHECKING:
     from .configuration_unispeech import UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechConfig

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_unispeech import (
              UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST,
              UniSpeechForCTC,
              UniSpeechForPreTraining,
              UniSpeechForSequenceClassification,
              UniSpeechModel,
              UniSpeechPreTrainedModel,
          )

else:
     import sys

     a_    :  Optional[Any]						  =		_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)