


import functools
import operator

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


__a	 =      logging.get_logger(__name__)

__a	 =      {
    """microsoft/unispeech-sat-base-100h-libri-ft""": (
        """https://huggingface.co/microsoft/unispeech-sat-base-100h-libri-ft/resolve/main/config.json"""
    ),
    # See all UniSpeechSat models at https://huggingface.co/models?filter=unispeech_sat
}






class 	__lowercase					(	__snake_case	):
      UpperCamelCase										=							'''unispeech-sat'''





      def __init__(		self    :       str       ,							__lowerCamelCase    :       int=3_2       ,							__lowerCamelCase    :       List[str]=7_6_8       ,							__lowerCamelCase    :       Tuple=1_2       ,							__lowerCamelCase    :       Tuple=1_2       ,							__lowerCamelCase    :       int=3_0_7_2       ,							__lowerCamelCase    :       Optional[Any]="gelu"       ,							__lowerCamelCase    :       Optional[Any]=0.1       ,							__lowerCamelCase    :       Optional[int]=0.1       ,							__lowerCamelCase    :       Any=0.1       ,							__lowerCamelCase    :       List[str]=0.0       ,							__lowerCamelCase    :       Any=0.0       ,							__lowerCamelCase    :       Union[str, Any]=0.1       ,							__lowerCamelCase    :       Optional[int]=0.1       ,							__lowerCamelCase    :       Tuple=0.02       ,							__lowerCamelCase    :       Optional[int]=1e-5       ,							__lowerCamelCase    :       List[str]="group"       ,							__lowerCamelCase    :       Optional[int]="gelu"       ,							__lowerCamelCase    :       List[str]=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)       ,							__lowerCamelCase    :       int=(5, 2, 2, 2, 2, 2, 2)       ,							__lowerCamelCase    :       Optional[Any]=(1_0, 3, 3, 3, 3, 2, 2)       ,							__lowerCamelCase    :       int=False       ,							__lowerCamelCase    :       Optional[Any]=1_2_8       ,							__lowerCamelCase    :       str=1_6       ,							__lowerCamelCase    :       str=False       ,							__lowerCamelCase    :       Any=True       ,							__lowerCamelCase    :       List[str]=0.05       ,							__lowerCamelCase    :       Optional[Any]=1_0       ,							__lowerCamelCase    :       Union[str, Any]=2       ,							__lowerCamelCase    :       Dict=0.0       ,							__lowerCamelCase    :       str=1_0       ,							__lowerCamelCase    :       Any=0       ,							__lowerCamelCase    :       Union[str, Any]=3_2_0       ,							__lowerCamelCase    :       Union[str, Any]=2       ,							__lowerCamelCase    :       Union[str, Any]=0.1       ,							__lowerCamelCase    :       Optional[int]=1_0_0       ,							__lowerCamelCase    :       str=2_5_6       ,							__lowerCamelCase    :       List[Any]=2_5_6       ,							__lowerCamelCase    :       Any=0.1       ,							__lowerCamelCase    :       Optional[Any]="mean"       ,							__lowerCamelCase    :       Optional[int]=False       ,							__lowerCamelCase    :       str=False       ,							__lowerCamelCase    :       List[str]=2_5_6       ,							__lowerCamelCase    :       Tuple=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)       ,							__lowerCamelCase    :       Any=(5, 3, 3, 1, 1)       ,							__lowerCamelCase    :       int=(1, 2, 3, 1, 1)       ,							__lowerCamelCase    :       Optional[int]=5_1_2       ,							__lowerCamelCase    :       Any=0       ,							__lowerCamelCase    :       Union[str, Any]=1       ,							__lowerCamelCase    :       int=2       ,							__lowerCamelCase    :       Union[str, Any]=5_0_4       ,							**__lowerCamelCase    :       Tuple       ,							)     -> Dict:






         """simple docstring"""







         super().__init__(**__lowerCamelCase       ,							pad_token_id=__lowerCamelCase       ,							bos_token_id=__lowerCamelCase       ,							eos_token_id=__lowerCamelCase							)
         UpperCAmelCase      					=  hidden_size
         UpperCAmelCase      					=  feat_extract_norm
         UpperCAmelCase      					=  feat_extract_activation
         UpperCAmelCase      					=  list(__lowerCamelCase							)
         UpperCAmelCase      					=  list(__lowerCamelCase							)
         UpperCAmelCase      					=  list(__lowerCamelCase							)
         UpperCAmelCase      					=  conv_bias
         UpperCAmelCase      					=  num_conv_pos_embeddings
         UpperCAmelCase      					=  num_conv_pos_embedding_groups
         UpperCAmelCase      					=  len(self.conv_dim							)
         UpperCAmelCase      					=  num_hidden_layers
         UpperCAmelCase      					=  intermediate_size
         UpperCAmelCase      					=  hidden_act
         UpperCAmelCase      					=  num_attention_heads
         UpperCAmelCase      					=  hidden_dropout
         UpperCAmelCase      					=  attention_dropout
         UpperCAmelCase      					=  activation_dropout
         UpperCAmelCase      					=  feat_proj_dropout
         UpperCAmelCase      					=  final_dropout
         UpperCAmelCase      					=  layerdrop
         UpperCAmelCase      					=  layer_norm_eps
         UpperCAmelCase      					=  initializer_range
         UpperCAmelCase      					=  vocab_size
         UpperCAmelCase      					=  num_clusters
         UpperCAmelCase      					=  do_stable_layer_norm
         UpperCAmelCase      					=  use_weighted_layer_sum

         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)`, but is `len(config.conv_dim) ="""
                F""" {len(self.conv_dim							)}`, `len(config.conv_stride) = {len(self.conv_stride							)}`,"""
                F""" `len(config.conv_kernel) = {len(self.conv_kernel							)}`."""							)

         # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
         UpperCAmelCase      					=  apply_spec_augment
         UpperCAmelCase      					=  mask_time_prob
         UpperCAmelCase      					=  mask_time_length
         UpperCAmelCase      					=  mask_time_min_masks
         UpperCAmelCase      					=  mask_feature_prob
         UpperCAmelCase      					=  mask_feature_length
         UpperCAmelCase      					=  mask_feature_min_masks

         # parameters for pretraining with codevector quantized representations
         UpperCAmelCase      					=  num_codevectors_per_group
         UpperCAmelCase      					=  num_codevector_groups
         UpperCAmelCase      					=  contrastive_logits_temperature
         UpperCAmelCase      					=  feat_quantizer_dropout
         UpperCAmelCase      					=  num_negatives
         UpperCAmelCase      					=  codevector_dim
         UpperCAmelCase      					=  proj_codevector_dim
         UpperCAmelCase      					=  diversity_loss_weight

         # ctc loss
         UpperCAmelCase      					=  ctc_loss_reduction
         UpperCAmelCase      					=  ctc_zero_infinity

         # SequenceClassification-specific parameter. Feel free to ignore for other classes.
         UpperCAmelCase      					=  classifier_proj_size

         # XVector-specific parameters. Feel free to ignore for other classes.
         UpperCAmelCase      					=  list(__lowerCamelCase							)
         UpperCAmelCase      					=  list(__lowerCamelCase							)
         UpperCAmelCase      					=  list(__lowerCamelCase							)
         UpperCAmelCase      					=  xvector_output_dim





      @property
      def 							_lowercase					(		self    :       Dict							)     -> Dict:






         """simple docstring"""







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







from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


__a	 =      logging.get_logger(__name__)

__a	 =      {
    """google/mobilenet_v1_1.0_224""": """https://huggingface.co/google/mobilenet_v1_1.0_224/resolve/main/config.json""",
    """google/mobilenet_v1_0.75_192""": """https://huggingface.co/google/mobilenet_v1_0.75_192/resolve/main/config.json""",
    # See all MobileNetV1 models at https://huggingface.co/models?filter=mobilenet_v1
}






class 	__lowercase					(	__snake_case	):
      UpperCamelCase										=							'''mobilenet_v1'''





      def __init__(		self    :       Any       ,							__lowerCamelCase    :       Union[str, Any]=3       ,							__lowerCamelCase    :       Dict=2_2_4       ,							__lowerCamelCase    :       Union[str, Any]=1.0       ,							__lowerCamelCase    :       Optional[int]=8       ,							__lowerCamelCase    :       Optional[int]="relu6"       ,							__lowerCamelCase    :       Optional[int]=True       ,							__lowerCamelCase    :       List[str]=0.999       ,							__lowerCamelCase    :       Optional[Any]=0.02       ,							__lowerCamelCase    :       str=0.001       ,							**__lowerCamelCase    :       Optional[Any]       ,							)     -> Optional[int]:






         """simple docstring"""







         super().__init__(**__lowerCamelCase							)

         if depth_multiplier <= 0:
            raise ValueError("""depth_multiplier must be greater than zero."""							)

         UpperCAmelCase      					=  num_channels
         UpperCAmelCase      					=  image_size
         UpperCAmelCase      					=  depth_multiplier
         UpperCAmelCase      					=  min_depth
         UpperCAmelCase      					=  hidden_act
         UpperCAmelCase      					=  tf_padding
         UpperCAmelCase      					=  classifier_dropout_prob
         UpperCAmelCase      					=  initializer_range
         UpperCAmelCase      					=  layer_norm_eps






class 	__lowercase					(	__snake_case	):
      UpperCamelCase										=							version.parse('''1.11'''	)





      @property
      def 							_lowercase					(		self    :       Optional[int]							)     -> Mapping[str, Mapping[int, str]]:






         """simple docstring"""







         return OrderedDict([("""pixel_values""", {0: """batch"""})]							)





      @property
      def 							_lowercase					(		self    :       Union[str, Any]							)     -> Mapping[str, Mapping[int, str]]:






         """simple docstring"""







         if self.task == "image-classification":
            return OrderedDict([("""logits""", {0: """batch"""})]							)
         else:
            return OrderedDict([("""last_hidden_state""", {0: """batch"""}), ("""pooler_output""", {0: """batch"""})]							)





      @property
      def 							_lowercase					(		self    :       List[Any]							)     -> float:






         """simple docstring"""







         return 1e-4



