



"""simple docstring"""





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


lowerCamelCase      =		logging.get_logger(__name__)

lowerCamelCase      =		{
    """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    lowercase__     (					SCREAMING_SNAKE_CASE   ):







							'''simple docstring'''


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



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


													'''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   lowercase__       (							self    :						Any					)				->		int:


													'''simple docstring'''




													return sum(self.block_sizes					)



							@num_hidden_layers.setter
							def   lowercase__       (							self    :						Optional[Any]	,       _UpperCAmelCase    :						Tuple					)				->		List[Any]:


													'''simple docstring'''




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



							@property
							def   lowercase__       (							self    :						Any					)				->		Optional[int]:


													'''simple docstring'''




													return len(self.block_sizes					)







							@num_blocks.setter
							def   lowercase__       (							self    :						Dict	,       _UpperCAmelCase    :						List[Any]					)				->		List[Any]:


													'''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


lowerCamelCase      =		logging.get_logger(__name__)

lowerCamelCase      =		{
    """YituTech/conv-bert-base""": """https://huggingface.co/YituTech/conv-bert-base/resolve/main/config.json""",
    """YituTech/conv-bert-medium-small""": (
        """https://huggingface.co/YituTech/conv-bert-medium-small/resolve/main/config.json"""
    ),
    """YituTech/conv-bert-small""": """https://huggingface.co/YituTech/conv-bert-small/resolve/main/config.json""",
    # See all ConvBERT models at https://huggingface.co/models?filter=convbert
}
class    lowercase__     (					SCREAMING_SNAKE_CASE   ):







       '''simple docstring'''


       UpperCamelCase		=  '''convbert'''



       def __init__(							self    :						Any	,       _UpperCAmelCase    :						Optional[int]=30522	,       _UpperCAmelCase    :						Tuple=768	,       _UpperCAmelCase    :						Optional[int]=12	,       _UpperCAmelCase    :						Dict=12	,       _UpperCAmelCase    :						Any=3072	,       _UpperCAmelCase    :						Dict="gelu"	,       _UpperCAmelCase    :						Optional[int]=0.1	,       _UpperCAmelCase    :						str=0.1	,       _UpperCAmelCase    :						Tuple=512	,       _UpperCAmelCase    :						Optional[Any]=2	,       _UpperCAmelCase    :						Union[str, Any]=0.02	,       _UpperCAmelCase    :						Dict=1e-12	,       _UpperCAmelCase    :						Optional[int]=1	,       _UpperCAmelCase    :						int=0	,       _UpperCAmelCase    :						Optional[Any]=2	,       _UpperCAmelCase    :						List[Any]=768	,       _UpperCAmelCase    :						Optional[int]=2	,       _UpperCAmelCase    :						str=9	,       _UpperCAmelCase    :						List[Any]=1	,       _UpperCAmelCase    :						Optional[Any]=None	,       **_UpperCAmelCase    :						str	,       )				->		List[Any]:


             '''simple docstring'''




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

             UpperCAmelCase_    				=							vocab_size
             UpperCAmelCase_    				=							hidden_size
             UpperCAmelCase_    				=							num_hidden_layers
             UpperCAmelCase_    				=							num_attention_heads
             UpperCAmelCase_    				=							intermediate_size
             UpperCAmelCase_    				=							hidden_act
             UpperCAmelCase_    				=							hidden_dropout_prob
             UpperCAmelCase_    				=							attention_probs_dropout_prob
             UpperCAmelCase_    				=							max_position_embeddings
             UpperCAmelCase_    				=							type_vocab_size
             UpperCAmelCase_    				=							initializer_range
             UpperCAmelCase_    				=							layer_norm_eps
             UpperCAmelCase_    				=							embedding_size
             UpperCAmelCase_    				=							head_ratio
             UpperCAmelCase_    				=							conv_kernel_size
             UpperCAmelCase_    				=							num_groups
             UpperCAmelCase_    				=							classifier_dropout



class    lowercase__     (					SCREAMING_SNAKE_CASE   ):







       '''simple docstring'''


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


             '''simple docstring'''




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




