



"""simple docstring"""

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


lowercase__			   =  logging.get_logger(__name__)

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




class SCREAMING_SNAKE_CASE__					(		__snake_case      ):
						_lowerCAmelCase							=					"openai-gpt"
						_lowerCAmelCase							=					{
						    "max_position_embeddings": "n_positions",
						    "hidden_size": "n_embd",
						    "num_attention_heads": "n_head",
						    "num_hidden_layers": "n_layer",
						}



						def __init__(self						,     _lowercase=40478						,     _lowercase=512						,     _lowercase=768						,     _lowercase=12						,     _lowercase=12						,     _lowercase="gelu"						,     _lowercase=0.1						,     _lowercase=0.1						,     _lowercase=0.1						,     _lowercase=1e-5						,     _lowercase=0.02						,     _lowercase="cls_index"						,     _lowercase=True						,     _lowercase=None						,     _lowercase=True						,     _lowercase=0.1						,     **_lowercase						,     ):





													'''simple docstring'''

													__a		:		Union[str, Any]									=       vocab_size
													__a		:		str									=       n_positions
													__a		:		Optional[Any]									=       n_embd
													__a		:		int									=       n_layer
													__a		:		List[Any]									=       n_head
													__a		:		Tuple									=       afn
													__a		:		Tuple									=       resid_pdrop
													__a		:		Optional[int]									=       embd_pdrop
													__a		:		Tuple									=       attn_pdrop
													__a		:		Optional[int]									=       layer_norm_epsilon
													__a		:		Dict									=       initializer_range
													__a		:		Union[str, Any]									=       summary_type
													__a		:		str									=       summary_use_proj
													__a		:		Union[str, Any]									=       summary_activation
													__a		:		List[Any]									=       summary_first_dropout
													__a		:		str									=       summary_proj_to_labels
													super().__init__(**_lowercase							)






"""simple docstring"""

import functools
import operator

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


lowercase__			   =  logging.get_logger(__name__)

lowercase__			   =  {
    "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 SCREAMING_SNAKE_CASE__					(		__snake_case      ):
						_lowerCAmelCase							=					"unispeech"



						def __init__(self						,     _lowercase=32						,     _lowercase=768						,     _lowercase=12						,     _lowercase=12						,     _lowercase=3072						,     _lowercase="gelu"						,     _lowercase=0.1						,     _lowercase=0.1						,     _lowercase=0.1						,     _lowercase=0.0						,     _lowercase=0.0						,     _lowercase=0.1						,     _lowercase=0.1						,     _lowercase=0.02						,     _lowercase=1e-5						,     _lowercase="group"						,     _lowercase="gelu"						,     _lowercase=(512, 512, 512, 512, 512, 512, 512)						,     _lowercase=(5, 2, 2, 2, 2, 2, 2)						,     _lowercase=(10, 3, 3, 3, 3, 2, 2)						,     _lowercase=False						,     _lowercase=128						,     _lowercase=16						,     _lowercase=False						,     _lowercase=True						,     _lowercase=0.05						,     _lowercase=10						,     _lowercase=2						,     _lowercase=0.0						,     _lowercase=10						,     _lowercase=0						,     _lowercase=320						,     _lowercase=2						,     _lowercase=0.1						,     _lowercase=100						,     _lowercase=256						,     _lowercase=256						,     _lowercase=0.1						,     _lowercase="mean"						,     _lowercase=False						,     _lowercase=False						,     _lowercase=256						,     _lowercase=80						,     _lowercase=0						,     _lowercase=1						,     _lowercase=2						,     _lowercase=0.5						,     **_lowercase						,     ):





													'''simple docstring'''

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

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

													# ctc loss
													__a		:		Any									=       ctc_loss_reduction
													__a		:		List[str]									=       ctc_zero_infinity

													# pretraining loss
													__a		:		Tuple									=       replace_prob





						@property
						def     lowerCAmelCase__(self							):





													'''simple docstring'''

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

