






import functools
import operator

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


UpperCamelCase    							=      logging.get_logger(__name__)

UpperCamelCase    							=      {
    '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 		_A						( UpperCAmelCase_ ):
  lowercase_						:			Dict						=					'''unispeech-sat'''

  def __init__(    self						:	List[Any]   ,				lowerCamelCase__						:	List[str]=32   ,				lowerCamelCase__						:	Optional[int]=7_68   ,				lowerCamelCase__						:	int=12   ,				lowerCamelCase__						:	Union[str, Any]=12   ,				lowerCamelCase__						:	Optional[Any]=30_72   ,				lowerCamelCase__						:	List[str]="gelu"   ,				lowerCamelCase__						:	List[str]=0.1   ,				lowerCamelCase__						:	int=0.1   ,				lowerCamelCase__						:	Optional[int]=0.1   ,				lowerCamelCase__						:	Any=0.0   ,				lowerCamelCase__						:	List[Any]=0.0   ,				lowerCamelCase__						:	List[str]=0.1   ,				lowerCamelCase__						:	List[str]=0.1   ,				lowerCamelCase__						:	Optional[Any]=0.02   ,				lowerCamelCase__						:	Dict=1e-5   ,				lowerCamelCase__						:	List[Any]="group"   ,				lowerCamelCase__						:	Union[str, Any]="gelu"   ,				lowerCamelCase__						:	Dict=(5_12, 5_12, 5_12, 5_12, 5_12, 5_12, 5_12)   ,				lowerCamelCase__						:	Dict=(5, 2, 2, 2, 2, 2, 2)   ,				lowerCamelCase__						:	Optional[Any]=(10, 3, 3, 3, 3, 2, 2)   ,				lowerCamelCase__						:	Tuple=False   ,				lowerCamelCase__						:	int=1_28   ,				lowerCamelCase__						:	Optional[int]=16   ,				lowerCamelCase__						:	int=False   ,				lowerCamelCase__						:	List[Any]=True   ,				lowerCamelCase__						:	List[str]=0.05   ,				lowerCamelCase__						:	List[str]=10   ,				lowerCamelCase__						:	str=2   ,				lowerCamelCase__						:	Union[str, Any]=0.0   ,				lowerCamelCase__						:	Optional[Any]=10   ,				lowerCamelCase__						:	Tuple=0   ,				lowerCamelCase__						:	Union[str, Any]=3_20   ,				lowerCamelCase__						:	str=2   ,				lowerCamelCase__						:	List[Any]=0.1   ,				lowerCamelCase__						:	Optional[int]=1_00   ,				lowerCamelCase__						:	Optional[int]=2_56   ,				lowerCamelCase__						:	Dict=2_56   ,				lowerCamelCase__						:	List[str]=0.1   ,				lowerCamelCase__						:	List[Any]="mean"   ,				lowerCamelCase__						:	str=False   ,				lowerCamelCase__						:	Tuple=False   ,				lowerCamelCase__						:	str=2_56   ,				lowerCamelCase__						:	Dict=(5_12, 5_12, 5_12, 5_12, 15_00)   ,				lowerCamelCase__						:	Optional[Any]=(5, 3, 3, 1, 1)   ,				lowerCamelCase__						:	Any=(1, 2, 3, 1, 1)   ,				lowerCamelCase__						:	List[str]=5_12   ,				lowerCamelCase__						:	Union[str, Any]=0   ,				lowerCamelCase__						:	Any=1   ,				lowerCamelCase__						:	Union[str, Any]=2   ,				lowerCamelCase__						:	List[str]=5_04   ,				**lowerCamelCase__						:	Tuple   ,				):
     """simple docstring"""

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

     # parameters for pretraining with codevector quantized representations
     __UpperCamelCase	:			Optional[int]					=					num_codevectors_per_group
     __UpperCamelCase	:			List[str]					=					num_codevector_groups
     __UpperCamelCase	:			Tuple					=					contrastive_logits_temperature
     __UpperCamelCase	:			Union[str, Any]					=					feat_quantizer_dropout
     __UpperCamelCase	:			List[str]					=					num_negatives
     __UpperCamelCase	:			Union[str, Any]					=					codevector_dim
     __UpperCamelCase	:			str					=					proj_codevector_dim
     __UpperCamelCase	:			Any					=					diversity_loss_weight

     # ctc loss
     __UpperCamelCase	:			Optional[int]					=					ctc_loss_reduction
     __UpperCamelCase	:			Tuple					=					ctc_zero_infinity

     # SequenceClassification-specific parameter. Feel free to ignore for other classes.
     __UpperCamelCase	:			str					=					classifier_proj_size

     # XVector-specific parameters. Feel free to ignore for other classes.
     __UpperCamelCase	:			str					=					list(lowerCamelCase__			)
     __UpperCamelCase	:			Union[str, Any]					=					list(lowerCamelCase__			)
     __UpperCamelCase	:			int					=					list(lowerCamelCase__			)
     __UpperCamelCase	:			Dict					=					xvector_output_dim

  @property
  def    a					(    self						:	Optional[int]			):
     """simple docstring"""

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











from collections.abc import Iterable
from typing import Generic, TypeVar

UpperCamelCase    							=      TypeVar('_T')







class 		_A						( Generic[_T] ):

  def __init__(    self						:	int   ,				lowerCamelCase__						:	Iterable[_T] | None = None			):
     """simple docstring"""

     __UpperCamelCase	:			list[_T]					=					list(iterable or []			)
     __UpperCamelCase	:			list[_T]					=					[]

  def __len__(    self						:	str			):
     """simple docstring"""

     return len(self._stacka			) + len(self._stacka			)

  def __repr__(    self						:	Dict			):
     """simple docstring"""

     return f'Queue({tuple(self._stacka[::-1] + self._stacka			)})'

  def    a					(    self						:	Union[str, Any]   ,				lowerCamelCase__						:	_T			):
     """simple docstring"""

     self._stacka.append(lowerCamelCase__			)

  def    a					(    self						:	Union[str, Any]			):
     """simple docstring"""

     __UpperCamelCase	:			Any					=					self._stacka.pop
     __UpperCamelCase	:			int					=					self._stacka.append

     if not self._stacka:
        while self._stacka:
           stacka_append(stacka_pop()			)

     if not self._stacka:
        raise IndexError("""Queue is empty"""			)
     return self._stacka.pop()


if __name__ == "__main__":
       from doctest import testmod

       testmod()



