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


lowercase_ 				=			logging.get_logger(__name__)

lowercase_ 				=			{
    """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 (							lowerCAmelCase__       ):






     """simple docstring"""







     lowerCAmelCase_							   =			'''funnel'''
     lowerCAmelCase_							   =			{
         '''hidden_size''': '''d_model''',
         '''num_attention_heads''': '''n_head''',
     }



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







       """simple docstring"""




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

       super().__init__(**_A )



     @property
     def  UpperCAmelCase__							(				self							:							Any ):







       """simple docstring"""




       return sum(self.block_sizes )



     @num_hidden_layers.setter
     def  UpperCAmelCase__							(				self							:							Dict     ,						_A							:							List[Any] ):







       """simple docstring"""




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



     @property
     def  UpperCAmelCase__							(				self							:							Tuple ):







       """simple docstring"""




       return len(self.block_sizes )




     @num_blocks.setter
     def  UpperCAmelCase__							(				self							:							Optional[int]     ,						_A							:							Optional[Any] ):







       """simple docstring"""




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


from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


lowercase    :   List[str]						=			{
    'configuration_gpt_bigcode': ['GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP', 'GPTBigCodeConfig'],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase    :   List[str]						=			[
		    'GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'GPTBigCodeForSequenceClassification',
		    'GPTBigCodeForTokenClassification',
		    'GPTBigCodeForCausalLM',
		    'GPTBigCodeModel',
		    'GPTBigCodePreTrainedModel',
		]

if TYPE_CHECKING:
		from .configuration_gpt_bigcode import GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_gpt_bigcode import (
				    GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST,
				    GPTBigCodeForCausalLM,
				    GPTBigCodeForSequenceClassification,
				    GPTBigCodeForTokenClassification,
				    GPTBigCodeModel,
				    GPTBigCodePreTrainedModel,
				)


else:
		import sys

		lowercase    :   Tuple						=			_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)