


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


snake_case_						:			Any													=							logging.get_logger(__name__)

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__							(		UpperCamelCase__  ):
						UpperCAmelCase             =						"funnel"
						UpperCAmelCase             =						{
						    "hidden_size": "d_model",
						    "num_attention_heads": "n_head",
						}




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


										"""simple docstring"""





										_SCREAMING_SNAKE_CASE			  =vocab_size
										_SCREAMING_SNAKE_CASE			  =block_sizes
										_SCREAMING_SNAKE_CASE			  =[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			  =num_decoder_layers
										_SCREAMING_SNAKE_CASE			  =d_model
										_SCREAMING_SNAKE_CASE			  =n_head
										_SCREAMING_SNAKE_CASE			  =d_head
										_SCREAMING_SNAKE_CASE			  =d_inner
										_SCREAMING_SNAKE_CASE			  =hidden_act
										_SCREAMING_SNAKE_CASE			  =hidden_dropout
										_SCREAMING_SNAKE_CASE			  =attention_dropout
										_SCREAMING_SNAKE_CASE			  =activation_dropout
										_SCREAMING_SNAKE_CASE			  =initializer_range
										_SCREAMING_SNAKE_CASE			  =initializer_std
										_SCREAMING_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."
										_SCREAMING_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."
										_SCREAMING_SNAKE_CASE			  =attention_type
										_SCREAMING_SNAKE_CASE			  =separate_cls
										_SCREAMING_SNAKE_CASE			  =truncate_seq
										_SCREAMING_SNAKE_CASE			  =pool_q_only

										super().__init__(**_a  )




						@property
						def 							__UpperCamelCase				(       self					:      List[Any]  )							->     Dict:


										"""simple docstring"""





										return sum(self.block_sizes  )




						@num_hidden_layers.setter
						def 							__UpperCamelCase				(       self					:      Dict				,    _a					:      Optional[int]  )							->     str:


										"""simple docstring"""





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




						@property
						def 							__UpperCamelCase				(       self					:      Any  )							->     int:


										"""simple docstring"""





										return len(self.block_sizes  )




						@num_blocks.setter
						def 							__UpperCamelCase				(       self					:      int				,    _a					:      Any  )							->     str:


										"""simple docstring"""





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



from collections import OrderedDict
from typing import Mapping

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


snake_case_						:			str													=							logging.get_logger(__name__)

snake_case_						:			str													=							{
    '''facebook/data2vec-text-base''': '''https://huggingface.co/data2vec/resolve/main/config.json''',
}

class 						A__							(		UpperCamelCase__  ):
						UpperCAmelCase             =						"data2vec-text"




						def __init__(       self					:      Optional[int]				,    _a					:      Union[str, Any]=3_0522				,    _a					:      Any=768				,    _a					:      List[Any]=12				,    _a					:      Any=12				,    _a					:      List[str]=3072				,    _a					:      Optional[Any]="gelu"				,    _a					:      List[str]=0.1				,    _a					:      Optional[Any]=0.1				,    _a					:      Optional[Any]=512				,    _a					:      Any=2				,    _a					:      Optional[Any]=0.02				,    _a					:      Dict=1E-12				,    _a					:      int=1				,    _a					:      Any=0				,    _a					:      List[Any]=2				,    _a					:      Dict="absolute"				,    _a					:      Optional[Any]=True				,    _a					:      Dict=None				,    **_a					:      Optional[Any]				,    )							->     Union[str, Any]:


										"""simple docstring"""





										super().__init__(pad_token_id=_a				,    bos_token_id=_a				,    eos_token_id=_a				,    **_a  )

										_SCREAMING_SNAKE_CASE			  =vocab_size
										_SCREAMING_SNAKE_CASE			  =hidden_size
										_SCREAMING_SNAKE_CASE			  =num_hidden_layers
										_SCREAMING_SNAKE_CASE			  =num_attention_heads
										_SCREAMING_SNAKE_CASE			  =hidden_act
										_SCREAMING_SNAKE_CASE			  =intermediate_size
										_SCREAMING_SNAKE_CASE			  =hidden_dropout_prob
										_SCREAMING_SNAKE_CASE			  =attention_probs_dropout_prob
										_SCREAMING_SNAKE_CASE			  =max_position_embeddings
										_SCREAMING_SNAKE_CASE			  =type_vocab_size
										_SCREAMING_SNAKE_CASE			  =initializer_range
										_SCREAMING_SNAKE_CASE			  =layer_norm_eps
										_SCREAMING_SNAKE_CASE			  =position_embedding_type
										_SCREAMING_SNAKE_CASE			  =use_cache
										_SCREAMING_SNAKE_CASE			  =classifier_dropout

class 						A__							(		UpperCamelCase__  ):




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


										"""simple docstring"""





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