




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


UpperCAmelCase_		:				Dict									=     logging.get_logger(__name__)

UpperCAmelCase_		:				List[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     						=					"""funnel"""
						UpperCamelCase     						=					{
						    """hidden_size""": """d_model""",
						    """num_attention_heads""": """n_head""",
						}

						def __init__(		self   :int    , __snake_case   :Tuple=3_05_22    , __snake_case   :Optional[Any]=[4, 4, 4]    , __snake_case   :Tuple=None    , __snake_case   :Optional[int]=2    , __snake_case   :int=7_68    , __snake_case   :Dict=12    , __snake_case   :List[str]=64    , __snake_case   :int=30_72    , __snake_case   :Optional[int]="gelu_new"    , __snake_case   :Dict=0.1    , __snake_case   :int=0.1    , __snake_case   :Dict=0.0    , __snake_case   :List[Any]=0.1    , __snake_case   :Optional[int]=None    , __snake_case   :int=1E-9    , __snake_case   :int="mean"    , __snake_case   :str="relative_shift"    , __snake_case   :Any=True    , __snake_case   :Optional[Any]=True    , __snake_case   :List[Any]=True    , **__snake_case   :Union[str, Any]    , ):
										'''simple docstring'''

										__magic_name__	:	Tuple								=vocab_size
										__magic_name__	:	Optional[Any]								=block_sizes
										__magic_name__	:	List[Any]								=[1] * len(__snake_case ) if block_repeats is None else block_repeats
										assert len(__snake_case ) == len(
										    self.block_repeats ), "`block_sizes` and `block_repeats` should have the same length."
										__magic_name__	:	int								=num_decoder_layers
										__magic_name__	:	Union[str, Any]								=d_model
										__magic_name__	:	List[Any]								=n_head
										__magic_name__	:	Union[str, Any]								=d_head
										__magic_name__	:	Any								=d_inner
										__magic_name__	:	Optional[Any]								=hidden_act
										__magic_name__	:	List[str]								=hidden_dropout
										__magic_name__	:	Optional[Any]								=attention_dropout
										__magic_name__	:	Any								=activation_dropout
										__magic_name__	:	str								=initializer_range
										__magic_name__	:	Optional[Any]								=initializer_std
										__magic_name__	:	Dict								=layer_norm_eps
										assert pooling_type in [
										    "mean",
										    "max",
										], f"Got {pooling_type} for `pooling_type` but only 'mean' and 'max' are supported."
										__magic_name__	:	Tuple								=pooling_type
										assert attention_type in [
										    "relative_shift",
										    "factorized",
										], f"Got {attention_type} for `attention_type` but only 'relative_shift' and 'factorized' are supported."
										__magic_name__	:	int								=attention_type
										__magic_name__	:	List[Any]								=separate_cls
										__magic_name__	:	Optional[int]								=truncate_seq
										__magic_name__	:	Tuple								=pool_q_only

										super().__init__(**__snake_case )

						@property
						def     A__						(		self   :List[Any] ):
										'''simple docstring'''

										return sum(self.block_sizes )

						@num_hidden_layers.setter
						def     A__						(		self   :Dict    , __snake_case   :Optional[Any] ):
										'''simple docstring'''

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

						@property
						def     A__						(		self   :Tuple ):
										'''simple docstring'''

										return len(self.block_sizes )


						@num_blocks.setter
						def     A__						(		self   :int    , __snake_case   :List[str] ):
										'''simple docstring'''

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










from ... import PretrainedConfig


UpperCAmelCase_		:				List[str]									=     {
    "sijunhe/nezha-cn-base": "https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json",
}




class 		__A      (			UpperCamelCase__			):
						UpperCamelCase     						=					NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP
						UpperCamelCase     						=					"""nezha"""

						def __init__(		self   :List[Any]    , __snake_case   :Optional[int]=2_11_28    , __snake_case   :Dict=7_68    , __snake_case   :str=12    , __snake_case   :List[Any]=12    , __snake_case   :Optional[int]=30_72    , __snake_case   :Any="gelu"    , __snake_case   :List[str]=0.1    , __snake_case   :Optional[int]=0.1    , __snake_case   :Dict=5_12    , __snake_case   :Optional[int]=64    , __snake_case   :Any=2    , __snake_case   :List[Any]=0.02    , __snake_case   :List[str]=1E-12    , __snake_case   :Any=0.1    , __snake_case   :str=0    , __snake_case   :int=2    , __snake_case   :str=3    , __snake_case   :Any=True    , **__snake_case   :Any    , ):
										'''simple docstring'''

										super().__init__(pad_token_id=__snake_case    , bos_token_id=__snake_case    , eos_token_id=__snake_case    , **__snake_case )

										__magic_name__	:	Tuple								=vocab_size
										__magic_name__	:	str								=hidden_size
										__magic_name__	:	Dict								=num_hidden_layers
										__magic_name__	:	str								=num_attention_heads
										__magic_name__	:	int								=hidden_act
										__magic_name__	:	Optional[int]								=intermediate_size
										__magic_name__	:	Union[str, Any]								=hidden_dropout_prob
										__magic_name__	:	Any								=attention_probs_dropout_prob
										__magic_name__	:	Union[str, Any]								=max_position_embeddings
										__magic_name__	:	str								=max_relative_position
										__magic_name__	:	Tuple								=type_vocab_size
										__magic_name__	:	str								=initializer_range
										__magic_name__	:	Tuple								=layer_norm_eps
										__magic_name__	:	Optional[int]								=classifier_dropout
										__magic_name__	:	List[str]								=use_cache




