



"""simple docstring"""
import functools
import operator

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


A:   List[Any]								=		logging.get_logger(__name__)

A:   Any								=		{
    "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       SCREAMING_SNAKE_CASE__  (					UpperCAmelCase__ ):
   __lowerCAmelCase  :   Tuple						=						'sew'

   def __init__(   self      ,     _SCREAMING_SNAKE_CASE=32      ,     _SCREAMING_SNAKE_CASE=768      ,     _SCREAMING_SNAKE_CASE=12      ,     _SCREAMING_SNAKE_CASE=12      ,     _SCREAMING_SNAKE_CASE=3072      ,     _SCREAMING_SNAKE_CASE=2      ,     _SCREAMING_SNAKE_CASE="gelu"      ,     _SCREAMING_SNAKE_CASE=0.1      ,     _SCREAMING_SNAKE_CASE=0.1      ,     _SCREAMING_SNAKE_CASE=0.1      ,     _SCREAMING_SNAKE_CASE=0.0      ,     _SCREAMING_SNAKE_CASE=0.1      ,     _SCREAMING_SNAKE_CASE=0.1      ,     _SCREAMING_SNAKE_CASE=0.02      ,     _SCREAMING_SNAKE_CASE=1E-5      ,     _SCREAMING_SNAKE_CASE="group"      ,     _SCREAMING_SNAKE_CASE="gelu"      ,     _SCREAMING_SNAKE_CASE=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)      ,     _SCREAMING_SNAKE_CASE=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)      ,     _SCREAMING_SNAKE_CASE=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=128      ,     _SCREAMING_SNAKE_CASE=16      ,     _SCREAMING_SNAKE_CASE=True      ,     _SCREAMING_SNAKE_CASE=0.05      ,     _SCREAMING_SNAKE_CASE=10      ,     _SCREAMING_SNAKE_CASE=2      ,     _SCREAMING_SNAKE_CASE=0.0      ,     _SCREAMING_SNAKE_CASE=10      ,     _SCREAMING_SNAKE_CASE=0      ,     _SCREAMING_SNAKE_CASE="mean"      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=False      ,     _SCREAMING_SNAKE_CASE=256      ,     _SCREAMING_SNAKE_CASE=0      ,     _SCREAMING_SNAKE_CASE=1      ,     _SCREAMING_SNAKE_CASE=2      ,     **_SCREAMING_SNAKE_CASE      ,     )  ->      int:





    '''simple docstring'''




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

    # ctc loss
    UpperCAmelCase	:					Optional[int]	=	ctc_loss_reduction
    UpperCAmelCase	:					int	=	ctc_zero_infinity

    # sequence classification
    UpperCAmelCase	:					Optional[int]	=	use_weighted_layer_sum
    UpperCAmelCase	:					Tuple	=	classifier_proj_size




   @property
   def 	SCREAMING_SNAKE_CASE     (   self						)  ->      str:





    '''simple docstring'''




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





"""simple docstring"""
from typing import TYPE_CHECKING

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


A:   str								=		{
    "configuration_distilbert": [
        "DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "DistilBertConfig",
        "DistilBertOnnxConfig",
    ],
    "tokenization_distilbert": ["DistilBertTokenizer"],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   Dict								=		["DistilBertTokenizerFast"]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   List[Any]								=		[
          "DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
          "DistilBertForMaskedLM",
          "DistilBertForMultipleChoice",
          "DistilBertForQuestionAnswering",
          "DistilBertForSequenceClassification",
          "DistilBertForTokenClassification",
          "DistilBertModel",
          "DistilBertPreTrainedModel",
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   Dict								=		[
          "TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST",
          "TFDistilBertForMaskedLM",
          "TFDistilBertForMultipleChoice",
          "TFDistilBertForQuestionAnswering",
          "TFDistilBertForSequenceClassification",
          "TFDistilBertForTokenClassification",
          "TFDistilBertMainLayer",
          "TFDistilBertModel",
          "TFDistilBertPreTrainedModel",
      ]

try:
      if not is_flax_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A:   int								=		[
          "FlaxDistilBertForMaskedLM",
          "FlaxDistilBertForMultipleChoice",
          "FlaxDistilBertForQuestionAnswering",
          "FlaxDistilBertForSequenceClassification",
          "FlaxDistilBertForTokenClassification",
          "FlaxDistilBertModel",
          "FlaxDistilBertPreTrainedModel",
      ]


if TYPE_CHECKING:
      from .configuration_distilbert import (
          DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
          DistilBertConfig,
          DistilBertOnnxConfig,
      )
      from .tokenization_distilbert import DistilBertTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_distilbert_fast import DistilBertTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_distilbert import (
                DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                DistilBertForMaskedLM,
                DistilBertForMultipleChoice,
                DistilBertForQuestionAnswering,
                DistilBertForSequenceClassification,
                DistilBertForTokenClassification,
                DistilBertModel,
                DistilBertPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_distilbert import (
                TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFDistilBertForMaskedLM,
                TFDistilBertForMultipleChoice,
                TFDistilBertForQuestionAnswering,
                TFDistilBertForSequenceClassification,
                TFDistilBertForTokenClassification,
                TFDistilBertMainLayer,
                TFDistilBertModel,
                TFDistilBertPreTrainedModel,
            )

      try:
            if not is_flax_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_flax_distilbert import (
                FlaxDistilBertForMaskedLM,
                FlaxDistilBertForMultipleChoice,
                FlaxDistilBertForQuestionAnswering,
                FlaxDistilBertForSequenceClassification,
                FlaxDistilBertForTokenClassification,
                FlaxDistilBertModel,
                FlaxDistilBertPreTrainedModel,
            )

else:
      import sys

      A:   Optional[int]								=		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
