





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        snake_case_    (		UpperCamelCase_						):
  A_      							=   """funnel"""
  A_      							=   {
      """hidden_size""": """d_model""",
      """num_attention_heads""": """n_head""",
  }






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






   '''simple docstring'''

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

   super().__init__(**_a      )






  @property
  def 				UpperCAmelCase__						(							self			:					List[str]      )->int:






   '''simple docstring'''

   return sum(self.block_sizes      )






  @num_hidden_layers.setter
  def 				UpperCAmelCase__						(							self			:					int       ,  _snake_case			:					Tuple      )->Dict:






   '''simple docstring'''

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






  @property
  def 				UpperCAmelCase__						(							self			:					int      )->Tuple:






   '''simple docstring'''

   return len(self.block_sizes      )






  @num_blocks.setter
  def 				UpperCAmelCase__						(							self			:					Union[str, Any]       ,  _snake_case			:					Optional[int]      )->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,
)


_UpperCAmelCase             =							{
    'configuration_gpt_bigcode': ['GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP', 'GPTBigCodeConfig'],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _UpperCAmelCase             =							[
          '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

      _UpperCAmelCase             =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)