





import functools
import operator

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


snake_case_           =      logging.get_logger(__name__)

snake_case_           =      {
    '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 		SCREAMING_SNAKE_CASE__    (	__lowercase  ):
      A_						:    Tuple							=   '''unispeech-sat'''


      def __init__(self	:				List[str]    ,      a__	:				Dict=32    ,      a__	:				Dict=768    ,      a__	:				List[str]=12    ,      a__	:				str=12    ,      a__	:				Union[str, Any]=3072    ,      a__	:				int="gelu"    ,      a__	:				Any=0.1    ,      a__	:				List[Any]=0.1    ,      a__	:				Any=0.1    ,      a__	:				Union[str, Any]=0.0    ,      a__	:				List[str]=0.0    ,      a__	:				Union[str, Any]=0.1    ,      a__	:				List[Any]=0.1    ,      a__	:				Optional[int]=0.0_2    ,      a__	:				List[Any]=1E-5    ,      a__	:				List[str]="group"    ,      a__	:				str="gelu"    ,      a__	:				Union[str, Any]=(512, 512, 512, 512, 512, 512, 512)    ,      a__	:				List[str]=(5, 2, 2, 2, 2, 2, 2)    ,      a__	:				str=(10, 3, 3, 3, 3, 2, 2)    ,      a__	:				Dict=False    ,      a__	:				Dict=128    ,      a__	:				Optional[int]=16    ,      a__	:				List[str]=False    ,      a__	:				str=True    ,      a__	:				Any=0.0_5    ,      a__	:				List[Any]=10    ,      a__	:				int=2    ,      a__	:				List[Any]=0.0    ,      a__	:				str=10    ,      a__	:				Tuple=0    ,      a__	:				str=320    ,      a__	:				Optional[int]=2    ,      a__	:				Dict=0.1    ,      a__	:				List[Any]=100    ,      a__	:				Union[str, Any]=256    ,      a__	:				List[Any]=256    ,      a__	:				List[Any]=0.1    ,      a__	:				List[Any]="mean"    ,      a__	:				Union[str, Any]=False    ,      a__	:				Optional[int]=False    ,      a__	:				List[str]=256    ,      a__	:				List[str]=(512, 512, 512, 512, 1500)    ,      a__	:				Tuple=(5, 3, 3, 1, 1)    ,      a__	:				Tuple=(1, 2, 3, 1, 1)    ,      a__	:				Dict=512    ,      a__	:				Any=0    ,      a__	:				List[Any]=1    ,      a__	:				List[Any]=2    ,      a__	:				Optional[int]=504    ,      **a__	:				List[Any]    ,      ):





         """simple docstring"""



         super().__init__(**UpperCAmelCase__    ,      pad_token_id=UpperCAmelCase__    ,      bos_token_id=UpperCAmelCase__    ,      eos_token_id=UpperCAmelCase__				)
         __snake_case								=       hidden_size
         __snake_case								=       feat_extract_norm
         __snake_case								=       feat_extract_activation
         __snake_case								=       list(UpperCAmelCase__				)
         __snake_case								=       list(UpperCAmelCase__				)
         __snake_case								=       list(UpperCAmelCase__				)
         __snake_case								=       conv_bias
         __snake_case								=       num_conv_pos_embeddings
         __snake_case								=       num_conv_pos_embedding_groups
         __snake_case								=       len(self.conv_dim				)
         __snake_case								=       num_hidden_layers
         __snake_case								=       intermediate_size
         __snake_case								=       hidden_act
         __snake_case								=       num_attention_heads
         __snake_case								=       hidden_dropout
         __snake_case								=       attention_dropout
         __snake_case								=       activation_dropout
         __snake_case								=       feat_proj_dropout
         __snake_case								=       final_dropout
         __snake_case								=       layerdrop
         __snake_case								=       layer_norm_eps
         __snake_case								=       initializer_range
         __snake_case								=       vocab_size
         __snake_case								=       num_clusters
         __snake_case								=       do_stable_layer_norm
         __snake_case								=       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
         __snake_case								=       apply_spec_augment
         __snake_case								=       mask_time_prob
         __snake_case								=       mask_time_length
         __snake_case								=       mask_time_min_masks
         __snake_case								=       mask_feature_prob
         __snake_case								=       mask_feature_length
         __snake_case								=       mask_feature_min_masks

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

         # ctc loss
         __snake_case								=       ctc_loss_reduction
         __snake_case								=       ctc_zero_infinity

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

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


      @property
      def        a			(self	:				Optional[Any]				):





         """simple docstring"""



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








# Copyright 2023 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from typing import TYPE_CHECKING

# rely on isort to merge the imports
from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available, is_vision_available


snake_case_           =      {
    'configuration_vivit': ['VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP', 'VivitConfig'],
}
try:
    if not is_vision_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      ['VivitImageProcessor']


try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    snake_case_           =      [
        'VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST',
        'VivitModel',
        'VivitPreTrainedModel',
        'VivitForVideoClassification',
    ]


if TYPE_CHECKING:
    from .configuration_vivit import VIVIT_PRETRAINED_CONFIG_ARCHIVE_MAP, VivitConfig

    try:
        if not is_vision_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .image_processing_vivit import VivitImageProcessor

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_vivit import (
            VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
            VivitForVideoClassification,
            VivitModel,
            VivitPreTrainedModel,
        )


else:
    import sys

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

