



import functools
import operator

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


_lowercase						  =		logging.get_logger(__name__)

_lowercase						  =		{
    "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     _UpperCAmelCase			(       __A     ):
     UpperCamelCase__		    =				'''sew'''




     def __init__(				self ,						a__=3_2 ,						a__=7_6_8 ,						a__=1_2 ,						a__=1_2 ,						a__=3_0_7_2 ,						a__=2 ,						a__="gelu" ,						a__=0.1 ,						a__=0.1 ,						a__=0.1 ,						a__=0.0 ,						a__=0.1 ,						a__=0.1 ,						a__=0.0_2 ,						a__=1e-5 ,						a__="group" ,						a__="gelu" ,						a__=(6_4, 1_2_8, 1_2_8, 1_2_8, 1_2_8, 2_5_6, 2_5_6, 2_5_6, 2_5_6, 5_1_2, 5_1_2, 5_1_2, 5_1_2) ,						a__=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1) ,						a__=(1_0, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1) ,						a__=False ,						a__=1_2_8 ,						a__=1_6 ,						a__=True ,						a__=0.0_5 ,						a__=1_0 ,						a__=2 ,						a__=0.0 ,						a__=1_0 ,						a__=0 ,						a__="mean" ,						a__=False ,						a__=False ,						a__=2_5_6 ,						a__=0 ,						a__=1 ,						a__=2 ,						**a__ ,						):
         super().__init__(**a__ ,						pad_token_id=a__ ,						bos_token_id=a__ ,						eos_token_id=a__)
         A__		 =					hidden_size
         A__		 =					feat_extract_norm
         A__		 =					feat_extract_activation
         A__		 =					list(a__)
         A__		 =					list(a__)
         A__		 =					list(a__)
         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__		 =					hidden_act
         A__		 =					num_attention_heads
         A__		 =					hidden_dropout
         A__		 =					attention_dropout
         A__		 =					activation_dropout
         A__		 =					feat_proj_dropout
         A__		 =					final_dropout
         A__		 =					layerdrop
         A__		 =					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 		snake_case_		(				self):
         return functools.reduce(operator.mul ,						self.conv_stride ,						1)








from typing import TYPE_CHECKING

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


_lowercase						  =		{
    "configuration_mobilevit": ["MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP", "MobileViTConfig", "MobileViTOnnxConfig"],
}

try:
   if not is_vision_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowercase						  =		["MobileViTFeatureExtractor"]
   _lowercase						  =		["MobileViTImageProcessor"]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowercase						  =		[
       "MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST",
       "MobileViTForImageClassification",
       "MobileViTForSemanticSegmentation",
       "MobileViTModel",
       "MobileViTPreTrainedModel",
   ]

try:
   if not is_tf_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowercase						  =		[
       "TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST",
       "TFMobileViTForImageClassification",
       "TFMobileViTForSemanticSegmentation",
       "TFMobileViTModel",
       "TFMobileViTPreTrainedModel",
   ]

if TYPE_CHECKING:
   from .configuration_mobilevit import MOBILEVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, MobileViTConfig, MobileViTOnnxConfig

   try:
      if not is_vision_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .feature_extraction_mobilevit import MobileViTFeatureExtractor
      from .image_processing_mobilevit import MobileViTImageProcessor

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_mobilevit import (
          MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
          MobileViTForImageClassification,
          MobileViTForSemanticSegmentation,
          MobileViTModel,
          MobileViTPreTrainedModel,
      )

   try:
      if not is_tf_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_tf_mobilevit import (
          TF_MOBILEVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
          TFMobileViTForImageClassification,
          TFMobileViTForSemanticSegmentation,
          TFMobileViTModel,
          TFMobileViTPreTrainedModel,
      )


else:
   import sys

   _lowercase						  =		_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
