






'''simple docstring'''



import functools
import operator

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


__UpperCamelCase      :       Any      			=      logging.get_logger(__name__)

__UpperCamelCase      :       str      			=      {
    """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       (							_lowerCAmelCase     ):
      __a  					="unispeech-sat"




      def __init__(  self ,   lowerCamelCase=32 ,   lowerCamelCase=768 ,   lowerCamelCase=12 ,   lowerCamelCase=12 ,   lowerCamelCase=3072 ,   lowerCamelCase="gelu" ,   lowerCamelCase=0.1 ,   lowerCamelCase=0.1 ,   lowerCamelCase=0.1 ,   lowerCamelCase=0.0 ,   lowerCamelCase=0.0 ,   lowerCamelCase=0.1 ,   lowerCamelCase=0.1 ,   lowerCamelCase=0.02 ,   lowerCamelCase=1e-5 ,   lowerCamelCase="group" ,   lowerCamelCase="gelu" ,   lowerCamelCase=(512, 512, 512, 512, 512, 512, 512) ,   lowerCamelCase=(5, 2, 2, 2, 2, 2, 2) ,   lowerCamelCase=(10, 3, 3, 3, 3, 2, 2) ,   lowerCamelCase=False ,   lowerCamelCase=128 ,   lowerCamelCase=16 ,   lowerCamelCase=False ,   lowerCamelCase=True ,   lowerCamelCase=0.05 ,   lowerCamelCase=10 ,   lowerCamelCase=2 ,   lowerCamelCase=0.0 ,   lowerCamelCase=10 ,   lowerCamelCase=0 ,   lowerCamelCase=320 ,   lowerCamelCase=2 ,   lowerCamelCase=0.1 ,   lowerCamelCase=100 ,   lowerCamelCase=256 ,   lowerCamelCase=256 ,   lowerCamelCase=0.1 ,   lowerCamelCase="mean" ,   lowerCamelCase=False ,   lowerCamelCase=False ,   lowerCamelCase=256 ,   lowerCamelCase=(512, 512, 512, 512, 1500) ,   lowerCamelCase=(5, 3, 3, 1, 1) ,   lowerCamelCase=(1, 2, 3, 1, 1) ,   lowerCamelCase=512 ,   lowerCamelCase=0 ,   lowerCamelCase=1 ,   lowerCamelCase=2 ,   lowerCamelCase=504 ,   **lowerCamelCase ,   )							->Optional[int]:



         '''simple docstring'''
         super().__init__(**lowerCamelCase ,   pad_token_id=lowerCamelCase ,   bos_token_id=lowerCamelCase ,   eos_token_id=lowerCamelCase      )
         __a				     =    hidden_size
         __a				     =    feat_extract_norm
         __a				     =    feat_extract_activation
         __a				     =    list(lowerCamelCase      )
         __a				     =    list(lowerCamelCase      )
         __a				     =    list(lowerCamelCase      )
         __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				     =    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
         __a				     =    num_clusters
         __a				     =    do_stable_layer_norm
         __a				     =    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
         __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

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

         # ctc loss
         __a				     =    ctc_loss_reduction
         __a				     =    ctc_zero_infinity

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

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






      @property
      def  __UpperCamelCase							(  self      )							->Tuple:



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







'''simple docstring'''



from typing import TYPE_CHECKING

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


__UpperCamelCase      :       Optional[int]      			=      {
    """configuration_deberta""": ["""DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """DebertaConfig""", """DebertaOnnxConfig"""],
    """tokenization_deberta""": ["""DebertaTokenizer"""],
}

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

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __UpperCamelCase      :       Tuple      			=      [
     """DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """DebertaForMaskedLM""",
     """DebertaForQuestionAnswering""",
     """DebertaForSequenceClassification""",
     """DebertaForTokenClassification""",
     """DebertaModel""",
     """DebertaPreTrainedModel""",
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 __UpperCamelCase      :       Optional[Any]      			=      [
     """TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """TFDebertaForMaskedLM""",
     """TFDebertaForQuestionAnswering""",
     """TFDebertaForSequenceClassification""",
     """TFDebertaForTokenClassification""",
     """TFDebertaModel""",
     """TFDebertaPreTrainedModel""",
 ]


if TYPE_CHECKING:
 from .configuration_deberta import DEBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, DebertaConfig, DebertaOnnxConfig
 from .tokenization_deberta import DebertaTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_deberta_fast import DebertaTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_deberta import (
      DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
      DebertaForMaskedLM,
      DebertaForQuestionAnswering,
      DebertaForSequenceClassification,
      DebertaForTokenClassification,
      DebertaModel,
      DebertaPreTrainedModel,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_deberta import (
      TF_DEBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFDebertaForMaskedLM,
      TFDebertaForQuestionAnswering,
      TFDebertaForSequenceClassification,
      TFDebertaForTokenClassification,
      TFDebertaModel,
      TFDebertaPreTrainedModel,
  )


else:
 import sys

 __UpperCamelCase      :       List[Any]      			=      _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)