





"""simple docstring"""




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


a		:				List[Any]  			=    logging.get_logger(__name__)

a		:				Dict  			=    {
    '''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       (		a__		):
							lowerCamelCase     :      Dict         ="""funnel"""
							lowerCamelCase     :      Any         ={
							    """hidden_size""": """d_model""",
							    """num_attention_heads""": """n_head""",
							}






							def __init__(     self   ,      lowerCAmelCase__=3_0522   ,      lowerCAmelCase__=[4, 4, 4]   ,      lowerCAmelCase__=None   ,      lowerCAmelCase__=2   ,      lowerCAmelCase__=768   ,      lowerCAmelCase__=12   ,      lowerCAmelCase__=64   ,      lowerCAmelCase__=3072   ,      lowerCAmelCase__="gelu_new"   ,      lowerCAmelCase__=0.1   ,      lowerCAmelCase__=0.1   ,      lowerCAmelCase__=0.0   ,      lowerCAmelCase__=0.1   ,      lowerCAmelCase__=None   ,      lowerCAmelCase__=1E-9   ,      lowerCAmelCase__="mean"   ,      lowerCAmelCase__="relative_shift"   ,      lowerCAmelCase__=True   ,      lowerCAmelCase__=True   ,      lowerCAmelCase__=True   ,      **lowerCAmelCase__   ,      )			->				int:
								a   :	Tuple			=       vocab_size
								a   :	List[Any]			=       block_sizes
								a   :	Dict			=       [1] * len(lowerCAmelCase__   ) if block_repeats is None else block_repeats
								assert len(lowerCAmelCase__   ) == len(
								    self.block_repeats   ), "`block_sizes` and `block_repeats` should have the same length."
								a   :	Dict			=       num_decoder_layers
								a   :	Optional[int]			=       d_model
								a   :	str			=       n_head
								a   :	Optional[Any]			=       d_head
								a   :	Union[str, Any]			=       d_inner
								a   :	List[Any]			=       hidden_act
								a   :	List[str]			=       hidden_dropout
								a   :	Any			=       attention_dropout
								a   :	Optional[int]			=       activation_dropout
								a   :	List[str]			=       initializer_range
								a   :	List[str]			=       initializer_std
								a   :	Any			=       layer_norm_eps
								assert pooling_type in [
								    "mean",
								    "max",
								], f"""Got {pooling_type} for `pooling_type` but only 'mean' and 'max' are supported."""
								a   :	Optional[int]			=       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   :	int			=       attention_type
								a   :	Optional[Any]			=       separate_cls
								a   :	List[str]			=       truncate_seq
								a   :	str			=       pool_q_only

								super().__init__(**lowerCAmelCase__   )






							@property
							def 					__a     (     self   )			->				Tuple:
								return sum(self.block_sizes   )






							@num_hidden_layers.setter
							def 					__a     (     self   ,      lowerCAmelCase__   )			->				List[Any]:
								raise NotImplementedError(
								    "This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`."   )






							@property
							def 					__a     (     self   )			->				Any:
								return len(self.block_sizes   )






							@num_blocks.setter
							def 					__a     (     self   ,      lowerCAmelCase__   )			->				List[str]:
								raise NotImplementedError("This model does not support the setting of `num_blocks`. Please set `block_sizes`."   )









"""simple docstring"""




from ..utils import DummyObject, requires_backends


class  __UpperCamelCase       (		metaclass=a__		):
							lowerCamelCase     :      Optional[Any]         =["""transformers""", """torch""", """note_seq"""]






							def __init__(     self   ,      *lowerCAmelCase__   ,      **lowerCAmelCase__   )			->				Union[str, Any]:
								requires_backends(self   ,      ["transformers", "torch", "note_seq"]   )






							@classmethod
							def 					__a     (     cls   ,      *lowerCAmelCase__   ,      **lowerCAmelCase__   )			->				Any:
								requires_backends(cls   ,      ["transformers", "torch", "note_seq"]   )






							@classmethod
							def 					__a     (     cls   ,      *lowerCAmelCase__   ,      **lowerCAmelCase__   )			->				int:
								requires_backends(cls   ,      ["transformers", "torch", "note_seq"]   )


