






'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCamelCase__ =			logging.get_logger(__name__)

UpperCamelCase__ =			{
    '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        _UpperCAmelCase						(		snake_case			):
    __lowerCamelCase:   Any		       =    'funnel'
    __lowerCamelCase:   int		       =    {
        'hidden_size': 'd_model',
        'num_attention_heads': 'n_head',
    }




    def __init__(			self  :       Optional[Any]  ,     a  :       Union[str, Any]=3_0_5_2_2  ,     a  :       List[Any]=[4, 4, 4]  ,     a  :       int=None  ,     a  :       List[str]=2  ,     a  :       str=7_6_8  ,     a  :       Union[str, Any]=1_2  ,     a  :       Union[str, Any]=6_4  ,     a  :       int=3_0_7_2  ,     a  :       str="gelu_new"  ,     a  :       int=0.1  ,     a  :       str=0.1  ,     a  :       Dict=0.0  ,     a  :       List[Any]=0.1  ,     a  :       int=None  ,     a  :       Optional[Any]=1e-9  ,     a  :       Optional[Any]="mean"  ,     a  :       Union[str, Any]="relative_shift"  ,     a  :       Tuple=True  ,     a  :       List[Any]=True  ,     a  :       Tuple=True  ,     **a  :       int  ,     ):






       '''simple docstring'''






       lowercase_	:    Optional[int]           =     vocab_size
       lowercase_	:    List[str]           =     block_sizes
       lowercase_	:    str           =     [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."
       lowercase_	:    List[Any]           =     num_decoder_layers
       lowercase_	:    List[Any]           =     d_model
       lowercase_	:    Union[str, Any]           =     n_head
       lowercase_	:    List[str]           =     d_head
       lowercase_	:    int           =     d_inner
       lowercase_	:    Optional[Any]           =     hidden_act
       lowercase_	:    Union[str, Any]           =     hidden_dropout
       lowercase_	:    Dict           =     attention_dropout
       lowercase_	:    Optional[int]           =     activation_dropout
       lowercase_	:    str           =     initializer_range
       lowercase_	:    List[Any]           =     initializer_std
       lowercase_	:    Optional[Any]           =     layer_norm_eps
       assert pooling_type in [
           "mean",
           "max",
       ], f"""Got {pooling_type} for `pooling_type` but only 'mean' and 'max' are supported."""
       lowercase_	:    Any           =     pooling_type
       assert attention_type in [
           "relative_shift",
           "factorized",
       ], f"""Got {attention_type} for `attention_type` but only 'relative_shift' and 'factorized' are supported."""
       lowercase_	:    Union[str, Any]           =     attention_type
       lowercase_	:    int           =     separate_cls
       lowercase_	:    List[Any]           =     truncate_seq
       lowercase_	:    List[Any]           =     pool_q_only

       super().__init__(**a			)




    @property
    def 				lowerCAmelCase__				(			self  :       Optional[Any]			):






       '''simple docstring'''






       return sum(self.block_sizes			)




    @num_hidden_layers.setter
    def 				lowerCAmelCase__				(			self  :       Dict  ,     a  :       Tuple			):






       '''simple docstring'''






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




    @property
    def 				lowerCAmelCase__				(			self  :       Union[str, Any]			):






       '''simple docstring'''






       return len(self.block_sizes			)





    @num_blocks.setter
    def 				lowerCAmelCase__				(			self  :       Dict  ,     a  :       Tuple			):






       '''simple docstring'''






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












'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


UpperCamelCase__ =			logging.get_logger(__name__)

UpperCamelCase__ =			{
    'abeja/gpt-neox-japanese-2.7b': 'https://huggingface.co/abeja/gpt-neox-japanese-2.7b/resolve/main/config.json',
}


class        _UpperCAmelCase						(		snake_case			):
    __lowerCamelCase:   List[Any]		       =    'gpt_neox_japanese'




    def __init__(			self  :       List[str]  ,     a  :       List[Any]=3_2_0_0_0  ,     a  :       Union[str, Any]=2_5_6_0  ,     a  :       Optional[Any]=3_2  ,     a  :       Any=3_2  ,     a  :       str=4  ,     a  :       Optional[int]="gelu"  ,     a  :       Optional[Any]=1.00  ,     a  :       Dict=1_0_0_0_0  ,     a  :       List[Any]=2_0_4_8  ,     a  :       Dict=0.02  ,     a  :       int=1e-5  ,     a  :       Optional[int]=True  ,     a  :       Union[str, Any]=3_1_9_9_6  ,     a  :       List[Any]=3_1_9_9_9  ,     a  :       List[str]=0.1  ,     a  :       Dict=0.0  ,     **a  :       Union[str, Any]  ,     ):






       '''simple docstring'''






       super().__init__(bos_token_id=a  ,     eos_token_id=a  ,     **a			)
       lowercase_	:    int           =     vocab_size
       lowercase_	:    int           =     max_position_embeddings
       lowercase_	:    List[str]           =     hidden_size
       lowercase_	:    Any           =     num_hidden_layers
       lowercase_	:    Any           =     num_attention_heads
       lowercase_	:    List[Any]           =     intermediate_multiple_size
       lowercase_	:    List[str]           =     hidden_act
       lowercase_	:    Optional[int]           =     rotary_pct
       lowercase_	:    Tuple           =     rotary_emb_base
       lowercase_	:    Optional[Any]           =     initializer_range
       lowercase_	:    List[str]           =     layer_norm_eps
       lowercase_	:    List[str]           =     use_cache
       lowercase_	:    Any           =     attention_dropout
       lowercase_	:    List[Any]           =     hidden_dropout




