





"""simple docstring"""





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


__A											=		logging.get_logger(__name__)

__A											=		{
    """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 					_lowerCAmelCase   (     a       ):
       """simple docstring"""




       __magic_name__     :List[Any]		  =					"""realm"""






       def __init__(    self    , __UpperCAmelCase=3_0_5_2_2    , __UpperCAmelCase=7_6_8    , __UpperCAmelCase=1_2_8    , __UpperCAmelCase=1_2    , __UpperCAmelCase=1_2    , __UpperCAmelCase=8    , __UpperCAmelCase=3_0_7_2    , __UpperCAmelCase="gelu_new"    , __UpperCAmelCase=0.1    , __UpperCAmelCase=0.1    , __UpperCAmelCase=5_1_2    , __UpperCAmelCase=2    , __UpperCAmelCase=0.02    , __UpperCAmelCase=1E-12    , __UpperCAmelCase=2_5_6    , __UpperCAmelCase=1_0    , __UpperCAmelCase=1E-3    , __UpperCAmelCase=5    , __UpperCAmelCase=3_2_0    , __UpperCAmelCase=1_3_3_5_3_7_1_8    , __UpperCAmelCase=5_0_0_0    , __UpperCAmelCase=1    , __UpperCAmelCase=0    , __UpperCAmelCase=2    , **__UpperCAmelCase    , ):



         '''simple docstring'''

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

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

         # Reader config
         lowerCAmelCase__			:Optional[Any]											=							span_hidden_size
         lowerCAmelCase__			:Dict											=							max_span_width
         lowerCAmelCase__			:Any											=							reader_layer_norm_eps
         lowerCAmelCase__			:Dict											=							reader_beam_size
         lowerCAmelCase__			:List[Any]											=							reader_seq_len

         # Retrieval config
         lowerCAmelCase__			:Optional[Any]											=							num_block_records
         lowerCAmelCase__			:Any											=							searcher_beam_size







"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
)


__A											=		{"""configuration_reformer""": ["""REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ReformerConfig"""]}

try:
  if not is_sentencepiece_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A											=		["""ReformerTokenizer"""]

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A											=		["""ReformerTokenizerFast"""]

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  __A											=		[
      """REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """ReformerAttention""",
      """ReformerForMaskedLM""",
      """ReformerForQuestionAnswering""",
      """ReformerForSequenceClassification""",
      """ReformerLayer""",
      """ReformerModel""",
      """ReformerModelWithLMHead""",
      """ReformerPreTrainedModel""",
  ]


if TYPE_CHECKING:
  from .configuration_reformer import REFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, ReformerConfig

  try:
    if not is_sentencepiece_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_reformer import ReformerTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_reformer_fast import ReformerTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_reformer import (
        REFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        ReformerAttention,
        ReformerForMaskedLM,
        ReformerForQuestionAnswering,
        ReformerForSequenceClassification,
        ReformerLayer,
        ReformerModel,
        ReformerModelWithLMHead,
        ReformerPreTrainedModel,
    )

else:
  import sys

  __A											=		_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)
