


import functools
import operator

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


__lowerCAmelCase		       =							logging.get_logger(__name__)

__lowerCAmelCase		       =							{
    '''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   __a			(    __UpperCamelCase      ):
 __lowercase :							List[str]        = 'sew'
 def __init__(   self				, lowerCAmelCase__=32				, lowerCAmelCase__=768				, lowerCAmelCase__=12				, lowerCAmelCase__=12				, lowerCAmelCase__=3_072				, lowerCAmelCase__=2				, lowerCAmelCase__="gelu"				, lowerCAmelCase__=0.1				, lowerCAmelCase__=0.1				, lowerCAmelCase__=0.1				, lowerCAmelCase__=0.0				, lowerCAmelCase__=0.1				, lowerCAmelCase__=0.1				, lowerCAmelCase__=0.0_2				, lowerCAmelCase__=1E-5				, lowerCAmelCase__="group"				, lowerCAmelCase__="gelu"				, lowerCAmelCase__=(64, 128, 128, 128, 128, 256, 256, 256, 256, 512, 512, 512, 512)				, lowerCAmelCase__=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)				, lowerCAmelCase__=(10, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)				, lowerCAmelCase__=False				, lowerCAmelCase__=128				, lowerCAmelCase__=16				, lowerCAmelCase__=True				, lowerCAmelCase__=0.0_5				, lowerCAmelCase__=10				, lowerCAmelCase__=2				, lowerCAmelCase__=0.0				, lowerCAmelCase__=10				, lowerCAmelCase__=0				, lowerCAmelCase__="mean"				, lowerCAmelCase__=False				, lowerCAmelCase__=False				, lowerCAmelCase__=256				, lowerCAmelCase__=0				, lowerCAmelCase__=1				, lowerCAmelCase__=2				, **lowerCAmelCase__				, )					->				Dict:




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

        # ctc loss
        lowercase__:   Any  			=   ctc_loss_reduction
        lowercase__:   Union[str, Any]  			=   ctc_zero_infinity

        # sequence classification
        lowercase__:   str  			=   use_weighted_layer_sum
        lowercase__:   Dict  			=   classifier_proj_size
 @property
 def 		SCREAMING_SNAKE_CASE__   (   self )					->				int:




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





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


lowercase_									=   {
    'configuration_bloom': ['BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP', 'BloomConfig', 'BloomOnnxConfig'],
}
try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   ['BloomTokenizerFast']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  lowercase_									=   [
      'BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST',
      'BloomForCausalLM',
      'BloomModel',
      'BloomPreTrainedModel',
      'BloomForSequenceClassification',
      'BloomForTokenClassification',
      'BloomForQuestionAnswering',
  ]

if TYPE_CHECKING:
  from .configuration_bloom import BLOOM_PRETRAINED_CONFIG_ARCHIVE_MAP, BloomConfig, BloomOnnxConfig

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_bloom_fast import BloomTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_bloom import (
        BLOOM_PRETRAINED_MODEL_ARCHIVE_LIST,
        BloomForCausalLM,
        BloomForQuestionAnswering,
        BloomForSequenceClassification,
        BloomForTokenClassification,
        BloomModel,
        BloomPreTrainedModel,
    )

else:
  import sys

  lowercase_									=   _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)


