





'''simple docstring'''






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 (					_A		):
		lowercase__:   Union[str, Any]				     =   "unispeech-sat"

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


					"""simple docstring"""

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

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

					# ctc loss
					__snake_case					:      Tuple							      =     ctc_loss_reduction
					__snake_case					:      Dict							      =     ctc_zero_infinity

					# SequenceClassification-specific parameter. Feel free to ignore for other classes.
					__snake_case					:      Union[str, Any]							      =     classifier_proj_size

					# XVector-specific parameters. Feel free to ignore for other classes.
					__snake_case					:      Optional[int]							      =     list(__lowerCAmelCase			)
					__snake_case					:      int							      =     list(__lowerCAmelCase			)
					__snake_case					:      Optional[Any]							      =     list(__lowerCAmelCase			)
					__snake_case					:      Any							      =     xvector_output_dim

		@property
		def 	lowercase__     (   self					:   Tuple			)					->    Dict:


					"""simple docstring"""

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







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


UpperCAmelCase_		 =					logging.get_logger(__name__)

UpperCAmelCase_		 =					{"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/config.json"""}


class 	lowerCamelCase__	(       _A):



 """simple docstring"""

 a__					: int =  "openai-gpt"
 a__					: Dict =  {
     "max_position_embeddings": "n_positions",
     "hidden_size": "n_embd",
     "num_attention_heads": "n_head",
     "num_hidden_layers": "n_layer",
 }

 def __init__(    self					:					Union[str, Any]			,						__lowerCAmelCase					:					int=4_04_78			,						__lowerCAmelCase					:					Tuple=5_12			,						__lowerCAmelCase					:					str=7_68			,						__lowerCAmelCase					:					List[Any]=12			,						__lowerCAmelCase					:					Any=12			,						__lowerCAmelCase					:					Dict="gelu"			,						__lowerCAmelCase					:					Union[str, Any]=0.1			,						__lowerCAmelCase					:					Optional[int]=0.1			,						__lowerCAmelCase					:					Any=0.1			,						__lowerCAmelCase					:					List[str]=1E-5			,						__lowerCAmelCase					:					Optional[int]=0.02			,						__lowerCAmelCase					:					Optional[Any]="cls_index"			,						__lowerCAmelCase					:					str=True			,						__lowerCAmelCase					:					int=None			,						__lowerCAmelCase					:					Optional[int]=True			,						__lowerCAmelCase					:					Optional[Any]=0.1			,						**__lowerCAmelCase					:					Tuple			,						)   ->	Optional[Any]:
    _A      =       vocab_size
    _A      =       n_positions
    _A      =       n_embd
    _A      =       n_layer
    _A      =       n_head
    _A      =       afn
    _A      =       resid_pdrop
    _A      =       embd_pdrop
    _A      =       attn_pdrop
    _A      =       layer_norm_epsilon
    _A      =       initializer_range
    _A      =       summary_type
    _A      =       summary_use_proj
    _A      =       summary_activation
    _A      =       summary_first_dropout
    _A      =       summary_proj_to_labels
    super().__init__(**__lowerCAmelCase      )



