

import functools
import operator

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


a__				=		logging.get_logger(__name__)

a__				=		{
    '''microsoft/unispeech-large-1500h-cv''': (
        '''https://huggingface.co/microsoft/unispeech-large-1500h-cv/resolve/main/config.json'''
    ),
    # See all UniSpeech models at https://huggingface.co/models?filter=unispeech
}

class 				UpperCAmelCase_		(			__lowercase   ):
							"""simple docstring"""







							UpperCAmelCase__       :						int	    =    "unispeech"


							def __init__(			self       ,							_a=3_2       ,							_a=7_6_8       ,							_a=1_2       ,							_a=1_2       ,							_a=3_0_7_2       ,							_a="gelu"       ,							_a=0.1       ,							_a=0.1       ,							_a=0.1       ,							_a=0.0       ,							_a=0.0       ,							_a=0.1       ,							_a=0.1       ,							_a=0.02       ,							_a=1e-5       ,							_a="group"       ,							_a="gelu"       ,							_a=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)       ,							_a=(5, 2, 2, 2, 2, 2, 2)       ,							_a=(1_0, 3, 3, 3, 3, 2, 2)       ,							_a=False       ,							_a=1_2_8       ,							_a=1_6       ,							_a=False       ,							_a=True       ,							_a=0.05       ,							_a=1_0       ,							_a=2       ,							_a=0.0       ,							_a=1_0       ,							_a=0       ,							_a=3_2_0       ,							_a=2       ,							_a=0.1       ,							_a=1_0_0       ,							_a=2_5_6       ,							_a=2_5_6       ,							_a=0.1       ,							_a="mean"       ,							_a=False       ,							_a=False       ,							_a=2_5_6       ,							_a=8_0       ,							_a=0       ,							_a=1       ,							_a=2       ,							_a=0.5       ,							**_a       ,							)    ->    Tuple:
												super().__init__(**_a       ,							pad_token_id=_a       ,							bos_token_id=_a       ,							eos_token_id=_a       )
												_a	:    Union[str, Any]         =		hidden_size
												_a	:    Tuple         =		feat_extract_norm
												_a	:    Dict         =		feat_extract_activation
												_a	:    List[Any]         =		list(_a       )
												_a	:    List[Any]         =		list(_a       )
												_a	:    Tuple         =		list(_a       )
												_a	:    Dict         =		conv_bias
												_a	:    str         =		num_conv_pos_embeddings
												_a	:    Optional[Any]         =		num_conv_pos_embedding_groups
												_a	:    str         =		len(self.conv_dim       )
												_a	:    Any         =		num_hidden_layers
												_a	:    Optional[Any]         =		intermediate_size
												_a	:    Union[str, Any]         =		hidden_act
												_a	:    Optional[int]         =		num_attention_heads
												_a	:    str         =		hidden_dropout
												_a	:    int         =		attention_dropout
												_a	:    Dict         =		activation_dropout
												_a	:    Optional[int]         =		feat_proj_dropout
												_a	:    str         =		final_dropout
												_a	:    Any         =		layerdrop
												_a	:    Dict         =		layer_norm_eps
												_a	:    Tuple         =		initializer_range
												_a	:    Any         =		num_ctc_classes
												_a	:    Dict         =		vocab_size
												_a	:    List[Any]         =		do_stable_layer_norm
												_a	:    List[Any]         =		use_weighted_layer_sum
												_a	:    Union[str, Any]         =		classifier_proj_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)`, 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	:    Any         =		apply_spec_augment
												_a	:    List[str]         =		mask_time_prob
												_a	:    List[str]         =		mask_time_length
												_a	:    Optional[int]         =		mask_time_min_masks
												_a	:    Dict         =		mask_feature_prob
												_a	:    List[str]         =		mask_feature_length
												_a	:    Optional[Any]         =		mask_feature_min_masks

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

												# ctc loss
												_a	:    Any         =		ctc_loss_reduction
												_a	:    List[Any]         =		ctc_zero_infinity

												# pretraining loss
												_a	:    List[Any]         =		replace_prob




							@property
							def 				__lowercase				(			self       )    ->    List[str]:
												return functools.reduce(operator.mul       ,							self.conv_stride       ,							1       )






import logging

from transformers import PretrainedConfig


a__				=		logging.getLogger(__name__)


a__				=		{
    '''bertabs-finetuned-cnndm''': '''https://huggingface.co/remi/bertabs-finetuned-cnndm-extractive-abstractive-summarization/resolve/main/config.json''',
}

class 				UpperCAmelCase_		(			__lowercase   ):
							"""simple docstring"""







							UpperCAmelCase__       :						Any	    =    "bertabs"


							def __init__(			self       ,							_a=3_0_5_2_2       ,							_a=5_1_2       ,							_a=6       ,							_a=5_1_2       ,							_a=8       ,							_a=5_1_2       ,							_a=0.2       ,							_a=6       ,							_a=7_6_8       ,							_a=8       ,							_a=2_0_4_8       ,							_a=0.2       ,							**_a       ,							)    ->    Any:
												super().__init__(**_a       )

												_a	:    int         =		vocab_size
												_a	:    List[str]         =		max_pos

												_a	:    Tuple         =		enc_layers
												_a	:    Optional[Any]         =		enc_hidden_size
												_a	:    int         =		enc_heads
												_a	:    Optional[Any]         =		enc_ff_size
												_a	:    List[str]         =		enc_dropout

												_a	:    Tuple         =		dec_layers
												_a	:    Optional[Any]         =		dec_hidden_size
												_a	:    Optional[Any]         =		dec_heads
												_a	:    Optional[Any]         =		dec_ff_size
												_a	:    List[Any]         =		dec_dropout



