






import functools
import operator

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


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

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



class 							_UpperCamelCase			(UpperCamelCase__			):
      snake_case_  =							"""sew-d"""


      def __init__(	self					,						__UpperCamelCase=3_2					,						__UpperCamelCase=7_6_8					,						__UpperCamelCase=1_2					,						__UpperCamelCase=1_2					,						__UpperCamelCase=3_0_7_2					,						__UpperCamelCase=2					,						__UpperCamelCase=5_1_2					,						__UpperCamelCase=2_5_6					,						__UpperCamelCase=True					,						__UpperCamelCase=True					,						__UpperCamelCase=("p2c", "c2p")					,						__UpperCamelCase="layer_norm"					,						__UpperCamelCase="gelu_python"					,						__UpperCamelCase=0.1					,						__UpperCamelCase=0.1					,						__UpperCamelCase=0.1					,						__UpperCamelCase=0.0					,						__UpperCamelCase=0.1					,						__UpperCamelCase=0.0_2					,						__UpperCamelCase=1e-7					,						__UpperCamelCase=1e-5					,						__UpperCamelCase="group"					,						__UpperCamelCase="gelu"					,						__UpperCamelCase=(6_4, 1_2_8, 1_2_8, 1_2_8, 1_2_8, 2_5_6, 2_5_6, 2_5_6, 2_5_6, 5_1_2, 5_1_2, 5_1_2, 5_1_2)					,						__UpperCamelCase=(5, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1)					,						__UpperCamelCase=(1_0, 3, 1, 3, 1, 3, 1, 3, 1, 2, 1, 2, 1)					,						__UpperCamelCase=False					,						__UpperCamelCase=1_2_8					,						__UpperCamelCase=1_6					,						__UpperCamelCase=True					,						__UpperCamelCase=0.0_5					,						__UpperCamelCase=1_0					,						__UpperCamelCase=2					,						__UpperCamelCase=0.0					,						__UpperCamelCase=1_0					,						__UpperCamelCase=0					,						__UpperCamelCase="mean"					,						__UpperCamelCase=False					,						__UpperCamelCase=False					,						__UpperCamelCase=2_5_6					,						__UpperCamelCase=0					,						__UpperCamelCase=1					,						__UpperCamelCase=2					,						**__UpperCamelCase					,						)->	int:
           super().__init__(**__A					,						pad_token_id=__A					,						bos_token_id=__A					,						eos_token_id=__A	)
           __lowerCAmelCase								=					hidden_size
           __lowerCAmelCase								=					feat_extract_norm
           __lowerCAmelCase								=					feat_extract_activation
           __lowerCAmelCase								=					list(__A	)
           __lowerCAmelCase								=					list(__A	)
           __lowerCAmelCase								=					list(__A	)
           __lowerCAmelCase								=					conv_bias
           __lowerCAmelCase								=					num_conv_pos_embeddings
           __lowerCAmelCase								=					num_conv_pos_embedding_groups
           __lowerCAmelCase								=					len(self.conv_dim	)
           __lowerCAmelCase								=					num_hidden_layers
           __lowerCAmelCase								=					intermediate_size
           __lowerCAmelCase								=					squeeze_factor
           __lowerCAmelCase								=					max_position_embeddings
           __lowerCAmelCase								=					position_buckets
           __lowerCAmelCase								=					share_att_key
           __lowerCAmelCase								=					relative_attention
           __lowerCAmelCase								=					norm_rel_ebd
           __lowerCAmelCase								=					list(__A	)
           __lowerCAmelCase								=					hidden_act
           __lowerCAmelCase								=					num_attention_heads
           __lowerCAmelCase								=					hidden_dropout
           __lowerCAmelCase								=					attention_dropout
           __lowerCAmelCase								=					activation_dropout
           __lowerCAmelCase								=					feat_proj_dropout
           __lowerCAmelCase								=					final_dropout
           __lowerCAmelCase								=					layer_norm_eps
           __lowerCAmelCase								=					feature_layer_norm_eps
           __lowerCAmelCase								=					initializer_range
           __lowerCAmelCase								=					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
           __lowerCAmelCase								=					apply_spec_augment
           __lowerCAmelCase								=					mask_time_prob
           __lowerCAmelCase								=					mask_time_length
           __lowerCAmelCase								=					mask_time_min_masks
           __lowerCAmelCase								=					mask_feature_prob
           __lowerCAmelCase								=					mask_feature_length
           __lowerCAmelCase								=					mask_feature_min_masks

           # ctc loss
           __lowerCAmelCase								=					ctc_loss_reduction
           __lowerCAmelCase								=					ctc_zero_infinity

           # sequence classification
           __lowerCAmelCase								=					use_weighted_layer_sum
           __lowerCAmelCase								=					classifier_proj_size


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














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


lowerCamelCase			:					List[str]         =	logging.get_logger(__name__)

lowerCamelCase			:					Dict         =	{
    '''microsoft/biogpt''': '''https://huggingface.co/microsoft/biogpt/resolve/main/config.json''',
    # See all BioGPT models at https://huggingface.co/models?filter=biogpt
}



class 							_UpperCamelCase			(a_			):
      snake_case_  =							"""biogpt"""


      def __init__(	self					,						__UpperCamelCase=4_2_3_8_4					,						__UpperCamelCase=1_0_2_4					,						__UpperCamelCase=2_4					,						__UpperCamelCase=1_6					,						__UpperCamelCase=4_0_9_6					,						__UpperCamelCase="gelu"					,						__UpperCamelCase=0.1					,						__UpperCamelCase=0.1					,						__UpperCamelCase=1_0_2_4					,						__UpperCamelCase=0.0_2					,						__UpperCamelCase=1e-12					,						__UpperCamelCase=True					,						__UpperCamelCase=True					,						__UpperCamelCase=0.0					,						__UpperCamelCase=0.0					,						__UpperCamelCase=1					,						__UpperCamelCase=0					,						__UpperCamelCase=2					,						**__UpperCamelCase					,						)->	Optional[Any]:
           __lowerCAmelCase								=					vocab_size
           __lowerCAmelCase								=					max_position_embeddings
           __lowerCAmelCase								=					hidden_size
           __lowerCAmelCase								=					num_hidden_layers
           __lowerCAmelCase								=					num_attention_heads
           __lowerCAmelCase								=					intermediate_size
           __lowerCAmelCase								=					hidden_act
           __lowerCAmelCase								=					hidden_dropout_prob
           __lowerCAmelCase								=					attention_probs_dropout_prob
           __lowerCAmelCase								=					initializer_range
           __lowerCAmelCase								=					layer_norm_eps
           __lowerCAmelCase								=					scale_embedding
           __lowerCAmelCase								=					use_cache
           __lowerCAmelCase								=					layerdrop
           __lowerCAmelCase								=					activation_dropout
           super().__init__(pad_token_id=__UpperCamelCase					,						bos_token_id=__UpperCamelCase					,						eos_token_id=__UpperCamelCase					,						**__UpperCamelCase	)






