
"""simple docstring"""

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


UpperCamelCase	:				int  	= logging.get_logger(__name__)

UpperCamelCase	:				Optional[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 __lowerCAmelCase		(      UpperCAmelCase__			):
     lowercase						   =						"funnel"
     lowercase						   =						{
         "hidden_size": "d_model",
         "num_attention_heads": "n_head",
     }





     def __init__(	self	,     __UpperCAmelCase=3_0522	,     __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	,     ):

      '''simple docstring'''




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

      super().__init__(**__UpperCAmelCase      )





     @property
     def 						UpperCAmelCase					(	self      ):

      '''simple docstring'''




      return sum(self.block_sizes      )





     @num_hidden_layers.setter
     def 						UpperCAmelCase					(	self	,     __UpperCAmelCase      ):

      '''simple docstring'''




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





     @property
     def 						UpperCAmelCase					(	self      ):

      '''simple docstring'''




      return len(self.block_sizes      )







     @num_blocks.setter
     def 						UpperCAmelCase					(	self	,     __UpperCAmelCase      ):

      '''simple docstring'''




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







'''simple docstring'''







from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


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

A__:    Union[str, Any]					    =       {
    '''facebook/data2vec-text-base''': '''https://huggingface.co/data2vec/resolve/main/config.json''',
}







class A__       (						UpperCAmelCase__      ):
      __UpperCamelCase       :  int	       =							"data2vec-text"






      def __init__( self			:str     ,						SCREAMING_SNAKE_CASE			:Optional[Any]=3_0_5_2_2     ,						SCREAMING_SNAKE_CASE			:Any=7_6_8     ,						SCREAMING_SNAKE_CASE			:List[Any]=1_2     ,						SCREAMING_SNAKE_CASE			:List[str]=1_2     ,						SCREAMING_SNAKE_CASE			:Dict=3_0_7_2     ,						SCREAMING_SNAKE_CASE			:List[str]="gelu"     ,						SCREAMING_SNAKE_CASE			:Any=0.1     ,						SCREAMING_SNAKE_CASE			:List[str]=0.1     ,						SCREAMING_SNAKE_CASE			:int=5_1_2     ,						SCREAMING_SNAKE_CASE			:int=2     ,						SCREAMING_SNAKE_CASE			:Union[str, Any]=0.02     ,						SCREAMING_SNAKE_CASE			:Dict=1e-12     ,						SCREAMING_SNAKE_CASE			:int=1     ,						SCREAMING_SNAKE_CASE			:Dict=0     ,						SCREAMING_SNAKE_CASE			:List[Any]=2     ,						SCREAMING_SNAKE_CASE			:str="absolute"     ,						SCREAMING_SNAKE_CASE			:Tuple=True     ,						SCREAMING_SNAKE_CASE			:Union[str, Any]=None     ,						**SCREAMING_SNAKE_CASE			:Union[str, Any]     ,						)       ->					List[str]:




             '''simple docstring'''
             super().__init__(pad_token_id=SCREAMING_SNAKE_CASE     ,						bos_token_id=SCREAMING_SNAKE_CASE     ,						eos_token_id=SCREAMING_SNAKE_CASE     ,						**SCREAMING_SNAKE_CASE	)

             _a    : Optional[Any]     					=vocab_size
             _a    : Optional[Any]     					=hidden_size
             _a    : Any     					=num_hidden_layers
             _a    : List[str]     					=num_attention_heads
             _a    : Union[str, Any]     					=hidden_act
             _a    : Any     					=intermediate_size
             _a    : str     					=hidden_dropout_prob
             _a    : Optional[Any]     					=attention_probs_dropout_prob
             _a    : Optional[Any]     					=max_position_embeddings
             _a    : Union[str, Any]     					=type_vocab_size
             _a    : Tuple     					=initializer_range
             _a    : Optional[int]     					=layer_norm_eps
             _a    : Tuple     					=position_embedding_type
             _a    : int     					=use_cache
             _a    : List[str]     					=classifier_dropout







class A__       (						UpperCAmelCase__      ):






      @property
      def __UpperCAmelCase       ( self			:int	)       ->					Mapping[str, Mapping[int, str]]:




             '''simple docstring'''
             if self.task == "multiple-choice":
                    _a    : Tuple     					={0: """batch""", 1: """choice""", 2: """sequence"""}
             else:
                    _a    : List[Any]     					={0: """batch""", 1: """sequence"""}
             return OrderedDict(
                 [
                     ("""input_ids""", dynamic_axis),
                     ("""attention_mask""", dynamic_axis),
                 ]	)


