




from collections import OrderedDict
from typing import Mapping

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


UpperCamelCase__     =	logging.get_logger(__name__)

UpperCamelCase__     =	{
    "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     __SCREAMING_SNAKE_CASE   (       _a    ):
							snake_case       : Any         =    """convbert"""






							def __init__(  self					,	__lowerCAmelCase=30522					,	__lowerCAmelCase=768					,	__lowerCAmelCase=12					,	__lowerCAmelCase=12					,	__lowerCAmelCase=3072					,	__lowerCAmelCase="gelu"					,	__lowerCAmelCase=0.1					,	__lowerCAmelCase=0.1					,	__lowerCAmelCase=512					,	__lowerCAmelCase=2					,	__lowerCAmelCase=0.02					,	__lowerCAmelCase=1E-12					,	__lowerCAmelCase=1					,	__lowerCAmelCase=0					,	__lowerCAmelCase=2					,	__lowerCAmelCase=768					,	__lowerCAmelCase=2					,	__lowerCAmelCase=9					,	__lowerCAmelCase=1					,	__lowerCAmelCase=None					,	**__lowerCAmelCase					,	):
														super().__init__(
														    pad_token_id=__lowerCAmelCase					,	bos_token_id=__lowerCAmelCase					,	eos_token_id=__lowerCAmelCase					,	**__lowerCAmelCase					,	)

														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     __SCREAMING_SNAKE_CASE   (       _a    ):






							@property
							def 			_lowerCamelCase						(  self					):
														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),
														    ]					)











UpperCamelCase__     =	{
    "meter": "m",
    "kilometer": "km",
    "megametre": "Mm",
    "gigametre": "Gm",
    "terametre": "Tm",
    "petametre": "Pm",
    "exametre": "Em",
    "zettametre": "Zm",
    "yottametre": "Ym",
}
# Exponent of the factor(meter)
UpperCamelCase__     =	{
    "m": 0,
    "km": 3,
    "Mm": 6,
    "Gm": 9,
    "Tm": 12,
    "Pm": 15,
    "Em": 18,
    "Zm": 21,
    "Ym": 24,
}





def       _UpperCamelCase       (a__				:float				,     a__				:str				,     a__				:str    ):






							"""simple docstring"""





							UpperCamelCase__			       =     from_type.lower().strip("""s"""    )
							UpperCamelCase__			       =     to_type.lower().strip("""s"""    )

							UpperCamelCase__			       =     UNIT_SYMBOL.get(a__				,     a__    )
							UpperCamelCase__			       =     UNIT_SYMBOL.get(a__				,     a__    )

							if from_sanitized not in METRIC_CONVERSION:
														UpperCamelCase__			       =     (
														    f"""Invalid 'from_type' value: {from_type!r}.\n"""
														    f"""Conversion abbreviations are: {", ".join(a__    )}"""
														)
														raise ValueError(a__    )
							if to_sanitized not in METRIC_CONVERSION:
														UpperCamelCase__			       =     (
														    f"""Invalid 'to_type' value: {to_type!r}.\n"""
														    f"""Conversion abbreviations are: {", ".join(a__    )}"""
														)
														raise ValueError(a__    )
							UpperCamelCase__			       =     METRIC_CONVERSION[from_sanitized]
							UpperCamelCase__			       =     METRIC_CONVERSION[to_sanitized]
							UpperCamelCase__			       =     1

							if from_exponent > to_exponent:
														UpperCamelCase__			       =     from_exponent - to_exponent
							else:
														UpperCamelCase__			       =     -(to_exponent - from_exponent)

							return value * pow(10				,     a__    )


if __name__ == "__main__":
					from doctest import testmod

					testmod()




