

'''simple docstring'''



import functools
import operator

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


__snake_case			:     int										=      logging.get_logger(__name__)

__snake_case			:     str										=      {
    'asapp/sew-tiny-100k': 'https://huggingface.co/asapp/sew-tiny-100k/resolve/main/config.json',
    # See all SEW models at https://huggingface.co/models?filter=sew
}



class lowerCamelCase			(  lowercase_						):



			'''simple docstring'''






			__snake_case        =	'sew'


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





									'''simple docstring'''
									super().__init__(**lowerCAmelCase_		,      pad_token_id=lowerCAmelCase_		,      bos_token_id=lowerCAmelCase_		,      eos_token_id=lowerCAmelCase_			)
									A__					:       int     =hidden_size
									A__					:       Optional[Any]     =feat_extract_norm
									A__					:       str     =feat_extract_activation
									A__					:       Dict     =list(lowerCAmelCase_			)
									A__					:       Union[str, Any]     =list(lowerCAmelCase_			)
									A__					:       str     =list(lowerCAmelCase_			)
									A__					:       Optional[Any]     =conv_bias
									A__					:       int     =num_conv_pos_embeddings
									A__					:       str     =num_conv_pos_embedding_groups
									A__					:       Optional[int]     =len(self.conv_dim			)
									A__					:       int     =num_hidden_layers
									A__					:       List[Any]     =intermediate_size
									A__					:       int     =squeeze_factor
									A__					:       str     =hidden_act
									A__					:       Any     =num_attention_heads
									A__					:       int     =hidden_dropout
									A__					:       List[Any]     =attention_dropout
									A__					:       Any     =activation_dropout
									A__					:       Dict     =feat_proj_dropout
									A__					:       Optional[int]     =final_dropout
									A__					:       Union[str, Any]     =layerdrop
									A__					:       Union[str, Any]     =layer_norm_eps
									A__					:       Optional[Any]     =initializer_range
									A__					:       Optional[int]     =vocab_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)`,"""
															    f"but is `len(config.conv_dim) = {len(self.conv_dim			)}`, `len(config.conv_stride)"
															    f"= {len(self.conv_stride			)}`, `len(config.conv_kernel) = {len(self.conv_kernel			)}`."			)

									# fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
									A__					:       int     =apply_spec_augment
									A__					:       Any     =mask_time_prob
									A__					:       Union[str, Any]     =mask_time_length
									A__					:       Dict     =mask_time_min_masks
									A__					:       int     =mask_feature_prob
									A__					:       Dict     =mask_feature_length
									A__					:       Any     =mask_feature_min_masks

									# ctc loss
									A__					:       Optional[int]     =ctc_loss_reduction
									A__					:       List[Any]     =ctc_zero_infinity

									# sequence classification
									A__					:       List[Any]     =use_weighted_layer_sum
									A__					:       Union[str, Any]     =classifier_proj_size



			@property
			def lowercase__						(				self	:						List[Any]			)      ->		Any:





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




'''simple docstring'''



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


__snake_case			:     Union[str, Any]										=      logging.get_logger(__name__)

__snake_case			:     Optional[int]										=      {
    'bigcode/gpt_bigcode-santacoder': 'https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json',
}



class lowerCamelCase			(  lowercase_						):



			'''simple docstring'''






			__snake_case        =	'gpt_bigcode'
			__snake_case        =	['past_key_values']
			__snake_case        =	{
			    'hidden_size': 'n_embd',
			    'max_position_embeddings': 'n_positions',
			    'num_attention_heads': 'n_head',
			    'num_hidden_layers': 'n_layer',
			}


			def __init__(				self	:						Optional[Any]		,      lowerCAmelCase_	:						List[str]=5_02_57		,      lowerCAmelCase_	:						str=10_24		,      lowerCAmelCase_	:						str=7_68		,      lowerCAmelCase_	:						str=12		,      lowerCAmelCase_	:						int=12		,      lowerCAmelCase_	:						Dict=None		,      lowerCAmelCase_	:						List[Any]="gelu_pytorch_tanh"		,      lowerCAmelCase_	:						Union[str, Any]=0.1		,      lowerCAmelCase_	:						Optional[Any]=0.1		,      lowerCAmelCase_	:						Optional[int]=0.1		,      lowerCAmelCase_	:						Dict=1e-5		,      lowerCAmelCase_	:						str=0.02		,      lowerCAmelCase_	:						List[Any]=True		,      lowerCAmelCase_	:						str=True		,      lowerCAmelCase_	:						str=5_02_56		,      lowerCAmelCase_	:						Dict=5_02_56		,      lowerCAmelCase_	:						Union[str, Any]=True		,      lowerCAmelCase_	:						str=True		,      lowerCAmelCase_	:						Optional[Any]=True		,      **lowerCAmelCase_	:						Optional[Any]		,      )      ->		Tuple:





									'''simple docstring'''
									A__					:       Optional[Any]     =vocab_size
									A__					:       Optional[Any]     =n_positions
									A__					:       List[str]     =n_embd
									A__					:       str     =n_layer
									A__					:       Optional[int]     =n_head
									A__					:       Optional[int]     =n_inner
									A__					:       int     =activation_function
									A__					:       int     =resid_pdrop
									A__					:       int     =embd_pdrop
									A__					:       Dict     =attn_pdrop
									A__					:       Any     =layer_norm_epsilon
									A__					:       List[Any]     =initializer_range
									A__					:       Dict     =scale_attn_weights
									A__					:       Any     =use_cache
									A__					:       List[Any]     =attention_softmax_in_fpaa
									A__					:       Optional[int]     =scale_attention_softmax_in_fpaa
									A__					:       Dict     =multi_query

									A__					:       List[str]     =bos_token_id
									A__					:       Any     =eos_token_id

									super().__init__(bos_token_id=lowerCAmelCase_		,      eos_token_id=lowerCAmelCase_		,      **lowerCAmelCase_			)

