



'''simple docstring'''






from collections import OrderedDict
from typing import Mapping

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


UpperCamelCase__:       Optional[int]							     =      logging.get_logger(__name__)

UpperCamelCase__:       Optional[Any]							     =      {
    "google/rembert": "https://huggingface.co/google/rembert/resolve/main/config.json",
    # See all RemBERT models at https://huggingface.co/models?filter=rembert
}

class     SCREAMING_SNAKE_CASE(							A__      ):







	"""simple docstring"""






	lowerCamelCase__      			=	"""rembert"""







	def __init__(						self      :					List[str]		,      __snake_case      :					Tuple=250300		,      __snake_case      :					Union[str, Any]=1152		,      __snake_case      :					Union[str, Any]=32		,      __snake_case      :					List[Any]=18		,      __snake_case      :					List[str]=256		,      __snake_case      :					Union[str, Any]=1664		,      __snake_case      :					Tuple=4608		,      __snake_case      :					int="gelu"		,      __snake_case      :					Union[str, Any]=0.0		,      __snake_case      :					Optional[Any]=0.0		,      __snake_case      :					str=0.1		,      __snake_case      :					Any=512		,      __snake_case      :					Tuple=2		,      __snake_case      :					List[str]=0.02		,      __snake_case      :					Union[str, Any]=1E-12		,      __snake_case      :					Union[str, Any]=True		,      __snake_case      :					Union[str, Any]=0		,      __snake_case      :					List[str]=312		,      __snake_case      :					List[Any]=313		,      **__snake_case      :					Optional[Any]		,      )      ->		int:
								super().__init__(pad_token_id=__snake_case		,      bos_token_id=__snake_case		,      eos_token_id=__snake_case		,      **__snake_case		)

								UpperCAmelCase			:	int										=		vocab_size
								UpperCAmelCase			:	List[str]										=		input_embedding_size
								UpperCAmelCase			:	Union[str, Any]										=		output_embedding_size
								UpperCAmelCase			:	Optional[Any]										=		max_position_embeddings
								UpperCAmelCase			:	Any										=		hidden_size
								UpperCAmelCase			:	Union[str, Any]										=		num_hidden_layers
								UpperCAmelCase			:	str										=		num_attention_heads
								UpperCAmelCase			:	List[str]										=		intermediate_size
								UpperCAmelCase			:	List[Any]										=		hidden_act
								UpperCAmelCase			:	List[str]										=		hidden_dropout_prob
								UpperCAmelCase			:	Union[str, Any]										=		attention_probs_dropout_prob
								UpperCAmelCase			:	Optional[Any]										=		classifier_dropout_prob
								UpperCAmelCase			:	Optional[Any]										=		initializer_range
								UpperCAmelCase			:	Tuple										=		type_vocab_size
								UpperCAmelCase			:	List[str]										=		layer_norm_eps
								UpperCAmelCase			:	List[str]										=		use_cache
								UpperCAmelCase			:	int										=		False

class     SCREAMING_SNAKE_CASE(							A__      ):







	"""simple docstring"""






	@property
	def 					A     (						self      :					List[str]		)      ->		Mapping[str, Mapping[int, str]]:
								if self.task == "multiple-choice":
															UpperCAmelCase			:	Union[str, Any]										=		{0: '''batch''', 1: '''choice''', 2: '''sequence'''}
								else:
															UpperCAmelCase			:	Dict										=		{0: '''batch''', 1: '''sequence'''}
								return OrderedDict(
								    [
								        ('''input_ids''', dynamic_axis),
								        ('''attention_mask''', dynamic_axis),
								        ('''token_type_ids''', dynamic_axis),
								    ]		)







	@property
	def 					A     (						self      :					Union[str, Any]		)      ->		float:
								return 1E-4










'''simple docstring'''






import importlib.metadata
import subprocess
import sys


def 			snake_case_					( _lowerCAmelCase  :						bool = False  )				->       str:
							UpperCAmelCase			:	List[str]										=		False
							if "IPython" in sys.modules:
														UpperCAmelCase			:	Optional[Any]										=		'''google.colab''' in str(sys.modules['''IPython'''].get_ipython()  )

							if in_colab:
														if upgrade:
																					UpperCAmelCase			:	List[Any]										=		['''pip''', '''install''', '''-U''', '''torch''']
																					subprocess.run(_lowerCAmelCase       ,				check=_lowerCAmelCase  )
														# get the current version of torch
														UpperCAmelCase			:	Dict										=		importlib.metadata.version('''torch'''  )
														UpperCAmelCase			:	int										=		torch_version[: torch_version.rindex('''.'''  )]
														UpperCAmelCase			:	Any										=		f"""https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-{torch_version_trunc}-cp37-cp37m-linux_x86_64.whl"""
														UpperCAmelCase			:	List[str]										=		['''pip''', '''install''', xla_wheel]
														subprocess.run(_lowerCAmelCase       ,				check=_lowerCAmelCase  )
							else:
														raise RuntimeError('''`install_xla` utility works only on google colab.'''  )





