



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


__snake_case						:Optional[Any]						=					logging.get_logger(__name__)

__snake_case						:str						=					{
    "funnel-transformer/small": "https://huggingface.co/funnel-transformer/small/resolve/main/config.json",
    "funnel-transformer/small-base": "https://huggingface.co/funnel-transformer/small-base/resolve/main/config.json",
    "funnel-transformer/medium": "https://huggingface.co/funnel-transformer/medium/resolve/main/config.json",
    "funnel-transformer/medium-base": "https://huggingface.co/funnel-transformer/medium-base/resolve/main/config.json",
    "funnel-transformer/intermediate": (
        "https://huggingface.co/funnel-transformer/intermediate/resolve/main/config.json"
    ),
    "funnel-transformer/intermediate-base": (
        "https://huggingface.co/funnel-transformer/intermediate-base/resolve/main/config.json"
    ),
    "funnel-transformer/large": "https://huggingface.co/funnel-transformer/large/resolve/main/config.json",
    "funnel-transformer/large-base": "https://huggingface.co/funnel-transformer/large-base/resolve/main/config.json",
    "funnel-transformer/xlarge": "https://huggingface.co/funnel-transformer/xlarge/resolve/main/config.json",
    "funnel-transformer/xlarge-base": "https://huggingface.co/funnel-transformer/xlarge-base/resolve/main/config.json",
}

class    _A	(     UpperCamelCase_   ):
       UpperCamelCase__  :   str						 =						"""funnel"""
       UpperCamelCase__  :   str						 =						{
           """hidden_size""": """d_model""",
           """num_attention_heads""": """n_head""",
       }



       def __init__(		self							:					Any					,		__SCREAMING_SNAKE_CASE							:					List[str]=30_522					,		__SCREAMING_SNAKE_CASE							:					Union[str, Any]=[4, 4, 4]					,		__SCREAMING_SNAKE_CASE							:					Tuple=None					,		__SCREAMING_SNAKE_CASE							:					List[str]=2					,		__SCREAMING_SNAKE_CASE							:					Optional[int]=768					,		__SCREAMING_SNAKE_CASE							:					Union[str, Any]=12					,		__SCREAMING_SNAKE_CASE							:					int=64					,		__SCREAMING_SNAKE_CASE							:					Tuple=3_072					,		__SCREAMING_SNAKE_CASE							:					Optional[int]="gelu_new"					,		__SCREAMING_SNAKE_CASE							:					Any=0.1					,		__SCREAMING_SNAKE_CASE							:					Tuple=0.1					,		__SCREAMING_SNAKE_CASE							:					Optional[int]=0.0					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=0.1					,		__SCREAMING_SNAKE_CASE							:					Tuple=None					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=1E-9					,		__SCREAMING_SNAKE_CASE							:					Tuple="mean"					,		__SCREAMING_SNAKE_CASE							:					List[Any]="relative_shift"					,		__SCREAMING_SNAKE_CASE							:					int=True					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=True					,		__SCREAMING_SNAKE_CASE							:					int=True					,		**__SCREAMING_SNAKE_CASE							:					Dict					,		):


           '''simple docstring'''

           __a							=    vocab_size
           __a							=    block_sizes
           __a							=    [1] * len(_a) if block_repeats is None else block_repeats
           assert len(_a) == len(
               self.block_repeats), "`block_sizes` and `block_repeats` should have the same length."
           __a							=    num_decoder_layers
           __a							=    d_model
           __a							=    n_head
           __a							=    d_head
           __a							=    d_inner
           __a							=    hidden_act
           __a							=    hidden_dropout
           __a							=    attention_dropout
           __a							=    activation_dropout
           __a							=    initializer_range
           __a							=    initializer_std
           __a							=    layer_norm_eps
           assert pooling_type in [
               "mean",
               "max",
           ], F'Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'
           __a							=    pooling_type
           assert attention_type in [
               "relative_shift",
               "factorized",
           ], F'Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'
           __a							=    attention_type
           __a							=    separate_cls
           __a							=    truncate_seq
           __a							=    pool_q_only

           super().__init__(**_a)



       @property
       def 		_lowerCamelCase      (		self							:					Any):


           '''simple docstring'''

           return sum(self.block_sizes)



       @num_hidden_layers.setter
       def 		_lowerCamelCase      (		self							:					Dict					,		__SCREAMING_SNAKE_CASE							:					Optional[int]):


           '''simple docstring'''

           raise NotImplementedError(
               '''This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.''')



       @property
       def 		_lowerCamelCase      (		self							:					str):


           '''simple docstring'''

           return len(self.block_sizes)





       @num_blocks.setter
       def 		_lowerCamelCase      (		self							:					Tuple					,		__SCREAMING_SNAKE_CASE							:					List[Any]):


           '''simple docstring'''

           raise NotImplementedError('''This model does not support the setting of `num_blocks`. Please set `block_sizes`.''')










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


__snake_case						:Dict						=					logging.get_logger(__name__)

__snake_case						:List[Any]						=					{
    '''tanreinama/GPTSAN-2.8B-spout_is_uniform''': (
        '''https://huggingface.co/tanreinama/GPTSAN-2.8B-spout_is_uniform/resolve/main/config.json'''
    ),
}

class    _A	(     __UpperCAmelCase   ):
       UpperCamelCase__  :   List[str]						 =						'''gptsan-japanese'''
       UpperCamelCase__  :   Dict						 =						[
           '''past_key_values''',
       ]
       UpperCamelCase__  :   Dict						 =						{
           '''hidden_size''': '''d_model''',
           '''num_attention_heads''': '''num_heads''',
           '''num_hidden_layers''': '''num_layers''',
       }



       def __init__(		self							:					List[str]					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=36_000					,		__SCREAMING_SNAKE_CASE							:					Tuple=1_280					,		__SCREAMING_SNAKE_CASE							:					List[Any]=1_024					,		__SCREAMING_SNAKE_CASE							:					List[Any]=8_192					,		__SCREAMING_SNAKE_CASE							:					str=4_096					,		__SCREAMING_SNAKE_CASE							:					Any=128					,		__SCREAMING_SNAKE_CASE							:					int=10					,		__SCREAMING_SNAKE_CASE							:					Optional[int]=0					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=16					,		__SCREAMING_SNAKE_CASE							:					List[Any]=16					,		__SCREAMING_SNAKE_CASE							:					Optional[Any]=128					,		__SCREAMING_SNAKE_CASE							:					Tuple=0.0					,		__SCREAMING_SNAKE_CASE							:					List[Any]=1E-5					,		__SCREAMING_SNAKE_CASE							:					str=False					,		__SCREAMING_SNAKE_CASE							:					Optional[int]=0.0					,		__SCREAMING_SNAKE_CASE							:					List[str]="float32"					,		__SCREAMING_SNAKE_CASE							:					List[str]=False					,		__SCREAMING_SNAKE_CASE							:					Any=False					,		__SCREAMING_SNAKE_CASE							:					Any=False					,		__SCREAMING_SNAKE_CASE							:					int=0.0_02					,		__SCREAMING_SNAKE_CASE							:					Any=False					,		__SCREAMING_SNAKE_CASE							:					Tuple=True					,		__SCREAMING_SNAKE_CASE							:					int=35_998					,		__SCREAMING_SNAKE_CASE							:					Optional[int]=35_995					,		__SCREAMING_SNAKE_CASE							:					List[str]=35_999					,		**__SCREAMING_SNAKE_CASE							:					List[str]					,		):


           '''simple docstring'''

           __a							=    vocab_size
           __a							=    max_position_embeddings
           __a							=    d_model
           __a							=    d_ff
           __a							=    d_ext
           __a							=    d_spout
           __a							=    num_switch_layers
           __a							=    num_ext_layers
           __a							=    num_switch_layers + num_ext_layers
           __a							=    num_heads
           __a							=    num_experts
           __a							=    expert_capacity
           __a							=    dropout_rate
           __a							=    layer_norm_epsilon
           __a							=    router_bias
           __a							=    router_jitter_noise
           __a							=    router_dtype
           __a							=    router_ignore_padding_tokens
           __a							=    output_hidden_states
           __a							=    output_attentions
           __a							=    initializer_factor
           __a							=    output_router_logits
           __a							=    use_cache

           super().__init__(
               separator_token_id=__SCREAMING_SNAKE_CASE					,		pad_token_id=__SCREAMING_SNAKE_CASE					,		eos_token_id=__SCREAMING_SNAKE_CASE					,		**__SCREAMING_SNAKE_CASE					,		)





