



'''simple docstring'''






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


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

lowerCAmelCase: Dict							=						{
    'google/realm-cc-news-pretrained-embedder': (
        'https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json'
    ),
    'google/realm-cc-news-pretrained-encoder': (
        'https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json'
    ),
    'google/realm-cc-news-pretrained-scorer': (
        'https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json'
    ),
    'google/realm-cc-news-pretrained-openqa': (
        'https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json'
    ),
    'google/realm-orqa-nq-openqa': 'https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json',
    'google/realm-orqa-nq-reader': 'https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json',
    'google/realm-orqa-wq-openqa': 'https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json',
    'google/realm-orqa-wq-reader': 'https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json',
    # See all REALM models at https://huggingface.co/models?filter=realm
}

class 							a__( lowerCamelCase__     ):
    lowercase__			=   """realm"""







    def __init__(				self			:  str						,      __snake_case			:  Union[str, Any]=3_05_22						,      __snake_case			:  Union[str, Any]=7_68						,      __snake_case			:  int=1_28						,      __snake_case			:  Union[str, Any]=12						,      __snake_case			:  List[Any]=12						,      __snake_case			:  Optional[Any]=8						,      __snake_case			:  Union[str, Any]=30_72						,      __snake_case			:  Optional[int]="gelu_new"						,      __snake_case			:  Tuple=0.1						,      __snake_case			:  Union[str, Any]=0.1						,      __snake_case			:  Optional[int]=5_12						,      __snake_case			:  Any=2						,      __snake_case			:  int=0.02						,      __snake_case			:  List[str]=1e-1_2						,      __snake_case			:  Dict=2_56						,      __snake_case			:  int=10						,      __snake_case			:  List[str]=1e-3						,      __snake_case			:  Dict=5						,      __snake_case			:  int=3_20						,      __snake_case			:  Tuple=13_35_37_18						,      __snake_case			:  Optional[Any]=50_00						,      __snake_case			:  str=1						,      __snake_case			:  List[Any]=0						,      __snake_case			:  Union[str, Any]=2						,      **__snake_case			:  Dict						,      ):
      super().__init__(pad_token_id=__snake_case						,      bos_token_id=__snake_case						,      eos_token_id=__snake_case						,      **__snake_case     )

      # Common config
      a						: Dict					       =					vocab_size
      a						: List[str]					       =					max_position_embeddings
      a						: Optional[int]					       =					hidden_size
      a						: List[Any]					       =					retriever_proj_size
      a						: Tuple					       =					num_hidden_layers
      a						: int					       =					num_attention_heads
      a						: Union[str, Any]					       =					num_candidates
      a						: str					       =					intermediate_size
      a						: Optional[int]					       =					hidden_act
      a						: str					       =					hidden_dropout_prob
      a						: int					       =					attention_probs_dropout_prob
      a						: Union[str, Any]					       =					initializer_range
      a						: Optional[Any]					       =					type_vocab_size
      a						: Union[str, Any]					       =					layer_norm_eps

      # Reader config
      a						: int					       =					span_hidden_size
      a						: Optional[int]					       =					max_span_width
      a						: Optional[Any]					       =					reader_layer_norm_eps
      a						: Tuple					       =					reader_beam_size
      a						: Optional[int]					       =					reader_seq_len

      # Retrieval config
      a						: List[str]					       =					num_block_records
      a						: Union[str, Any]					       =					searcher_beam_size




'''simple docstring'''






lowerCAmelCase: Union[str, Any]							=						{
    'meter': 'm',
    'kilometer': 'km',
    'megametre': 'Mm',
    'gigametre': 'Gm',
    'terametre': 'Tm',
    'petametre': 'Pm',
    'exametre': 'Em',
    'zettametre': 'Zm',
    'yottametre': 'Ym',
}
# Exponent of the factor(meter)
lowerCAmelCase: Optional[Any]							=						{
    'm': 0,
    'km': 3,
    'Mm': 6,
    'Gm': 9,
    'Tm': 1_2,
    'Pm': 1_5,
    'Em': 1_8,
    'Zm': 2_1,
    'Ym': 2_4,
}
def 				lowerCamelCase__	(						_A			,      _A			,      _A    ):
  a						: Optional[int]					       =					from_type.lower().strip('s'    )
  a						: Optional[Any]					       =					to_type.lower().strip('s'    )

  a						: Dict					       =					UNIT_SYMBOL.get(_A			,      _A    )
  a						: Optional[Any]					       =					UNIT_SYMBOL.get(_A			,      _A    )

  if from_sanitized not in METRIC_CONVERSION:
    a						: Optional[Any]					       =					(
        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:
    a						: Union[str, Any]					       =					(
        f"""Invalid 'to_type' value: {to_type!r}.\n"""
        f"""Conversion abbreviations are: {", ".join(_A    )}"""
    )
    raise ValueError(_A    )
  a						: List[Any]					       =					METRIC_CONVERSION[from_sanitized]
  a						: int					       =					METRIC_CONVERSION[to_sanitized]
  a						: Tuple					       =					1

  if from_exponent > to_exponent:
    a						: Optional[int]					       =					from_exponent - to_exponent
  else:
    a						: Optional[Any]					       =					-(to_exponent - from_exponent)

  return value * pow(10			,      _A    )


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

     testmod()