






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


_SCREAMING_SNAKE_CASE      :			List[str]      				=   logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE      :			int      				=   {
    "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__ (   snake_case__     ):







    """simple docstring"""

    __magic_name__        =		'funnel'
    __magic_name__        =		{
        'hidden_size': 'd_model',
        'num_attention_heads': 'n_head',
    }
    def __init__(	self      , __snake_case=3_0_5_2_2      , __snake_case=[4, 4, 4]      , __snake_case=None      , __snake_case=2      , __snake_case=7_6_8      , __snake_case=1_2      , __snake_case=6_4      , __snake_case=3_0_7_2      , __snake_case="gelu_new"      , __snake_case=0.1      , __snake_case=0.1      , __snake_case=0.0      , __snake_case=0.1      , __snake_case=None      , __snake_case=1E-9      , __snake_case="mean"      , __snake_case="relative_shift"      , __snake_case=True      , __snake_case=True      , __snake_case=True      , **__snake_case      , ):
         snake_case					=    vocab_size
         snake_case					=    block_sizes
         snake_case					=    [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."
         snake_case					=    num_decoder_layers
         snake_case					=    d_model
         snake_case					=    n_head
         snake_case					=    d_head
         snake_case					=    d_inner
         snake_case					=    hidden_act
         snake_case					=    hidden_dropout
         snake_case					=    attention_dropout
         snake_case					=    activation_dropout
         snake_case					=    initializer_range
         snake_case					=    initializer_std
         snake_case					=    layer_norm_eps
         assert pooling_type in [
             "mean",
             "max",
         ], F'''Got {pooling_type} for `pooling_type` but only \'mean\' and \'max\' are supported.'''
         snake_case					=    pooling_type
         assert attention_type in [
             "relative_shift",
             "factorized",
         ], F'''Got {attention_type} for `attention_type` but only \'relative_shift\' and \'factorized\' are supported.'''
         snake_case					=    attention_type
         snake_case					=    separate_cls
         snake_case					=    truncate_seq
         snake_case					=    pool_q_only

         super().__init__(**__snake_case   )
    @property
    def 		a_      (	self   ):
         return sum(self.block_sizes   )
    @num_hidden_layers.setter
    def 		a_      (	self      , __snake_case   ):
         raise NotImplementedError(
             '''This model does not support the setting of `num_hidden_layers`. Please set `block_sizes`.'''   )
    @property
    def 		a_      (	self   ):
         return len(self.block_sizes   )




    @num_blocks.setter
    def 		a_      (	self      , __snake_case   ):
         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, is_vision_available


_SCREAMING_SNAKE_CASE      :			Dict      				=   {"configuration_van": ["VAN_PRETRAINED_CONFIG_ARCHIVE_MAP", "VanConfig"]}


try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _SCREAMING_SNAKE_CASE      :			Dict      				=   [
     "VAN_PRETRAINED_MODEL_ARCHIVE_LIST",
     "VanForImageClassification",
     "VanModel",
     "VanPreTrainedModel",
 ]

if TYPE_CHECKING:
 from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_van import (
      VAN_PRETRAINED_MODEL_ARCHIVE_LIST,
      VanForImageClassification,
      VanModel,
      VanPreTrainedModel,
  )

else:
 import sys

 _SCREAMING_SNAKE_CASE      :			str      				=   _LazyModule(__name__, globals()["__file__"], _import_structure)




