





"""simple docstring"""




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


UpperCAmelCase__  :     Any   			=logging.get_logger(__name__)

UpperCAmelCase__  :     Union[str, Any]   			={
    '''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       (  a      ):
				__A								=			"""funnel"""
				__A								=			{
				    """hidden_size""": """d_model""",
				    """num_attention_heads""": """n_head""",
				}


				def __init__(						self				,	UpperCAmelCase_=30522				,	UpperCAmelCase_=[4, 4, 4]				,	UpperCAmelCase_=None				,	UpperCAmelCase_=2				,	UpperCAmelCase_=768				,	UpperCAmelCase_=12				,	UpperCAmelCase_=64				,	UpperCAmelCase_=3072				,	UpperCAmelCase_="gelu_new"				,	UpperCAmelCase_=0.1				,	UpperCAmelCase_=0.1				,	UpperCAmelCase_=0.0				,	UpperCAmelCase_=0.1				,	UpperCAmelCase_=None				,	UpperCAmelCase_=1E-9				,	UpperCAmelCase_="mean"				,	UpperCAmelCase_="relative_shift"				,	UpperCAmelCase_=True				,	UpperCAmelCase_=True				,	UpperCAmelCase_=True				,	**UpperCAmelCase_				,	):
								lowerCamelCase			=vocab_size
								lowerCamelCase			=block_sizes
								lowerCamelCase			=[1] * len(UpperCAmelCase_							) if block_repeats is None else block_repeats
								assert len(UpperCAmelCase_							) == len(
								    self.block_repeats							), "`block_sizes` and `block_repeats` should have the same length."
								lowerCamelCase			=num_decoder_layers
								lowerCamelCase			=d_model
								lowerCamelCase			=n_head
								lowerCamelCase			=d_head
								lowerCamelCase			=d_inner
								lowerCamelCase			=hidden_act
								lowerCamelCase			=hidden_dropout
								lowerCamelCase			=attention_dropout
								lowerCamelCase			=activation_dropout
								lowerCamelCase			=initializer_range
								lowerCamelCase			=initializer_std
								lowerCamelCase			=layer_norm_eps
								assert pooling_type in [
								    "mean",
								    "max",
								], f"""Got {pooling_type} for `pooling_type` but only 'mean' and 'max' are supported."""
								lowerCamelCase			=pooling_type
								assert attention_type in [
								    "relative_shift",
								    "factorized",
								], f"""Got {attention_type} for `attention_type` but only 'relative_shift' and 'factorized' are supported."""
								lowerCamelCase			=attention_type
								lowerCamelCase			=separate_cls
								lowerCamelCase			=truncate_seq
								lowerCamelCase			=pool_q_only

								super().__init__(**UpperCAmelCase_							)


				@property
				def _snake_case    (						self							):
								return sum(self.block_sizes							)


				@num_hidden_layers.setter
				def _snake_case    (						self				,	UpperCAmelCase_							):
								raise NotImplementedError(
								    """This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`."""							)


				@property
				def _snake_case    (						self							):
								return len(self.block_sizes							)


				@num_blocks.setter
				def _snake_case    (						self				,	UpperCAmelCase_							):
								raise NotImplementedError("""This model does not support the setting of `num_blocks`. Please set `block_sizes`."""							)












from __future__ import annotations

from typing import Dict

from ...configuration_utils import PretrainedConfig


UpperCAmelCase__  :     Optional[Any]   			={
    '''susnato/ernie-m-base_pytorch''': '''https://huggingface.co/susnato/ernie-m-base_pytorch/blob/main/config.json''',
    '''susnato/ernie-m-large_pytorch''': '''https://huggingface.co/susnato/ernie-m-large_pytorch/blob/main/config.json''',
}

class  __A       (  a      ):
				__A								=			"""ernie_m"""
				__A								=			{"dropout": "classifier_dropout", "num_classes": "num_labels"}


				def __init__(						self				,	UpperCAmelCase_ = 250002				,	UpperCAmelCase_ = 768				,	UpperCAmelCase_ = 12				,	UpperCAmelCase_ = 12				,	UpperCAmelCase_ = 3072				,	UpperCAmelCase_ = "gelu"				,	UpperCAmelCase_ = 0.1				,	UpperCAmelCase_ = 0.1				,	UpperCAmelCase_ = 514				,	UpperCAmelCase_ = 0.0_2				,	UpperCAmelCase_ = 1				,	UpperCAmelCase_ = 1E-05				,	UpperCAmelCase_=None				,	UpperCAmelCase_=False				,	UpperCAmelCase_=0.0				,	**UpperCAmelCase_				,	):
								super().__init__(pad_token_id=UpperCAmelCase_				,	**UpperCAmelCase_							)
								lowerCamelCase			=vocab_size
								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			=max_position_embeddings
								lowerCamelCase			=initializer_range
								lowerCamelCase			=layer_norm_eps
								lowerCamelCase			=classifier_dropout
								lowerCamelCase			=is_decoder
								lowerCamelCase			=act_dropout





