





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


_snake_case  :    Optional[Any]						    =  logging.get_logger(__name__)

_snake_case  :    Union[str, Any]						    =  {
    """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 				_UpperCAmelCase    (    _UpperCAmelCase    ):

  """simple docstring"""


  a_        = 'realm'






  def __init__(				self :		Dict					,  lowerCAmelCase_ :		Optional[int]=3_0_5_2_2					,  lowerCAmelCase_ :		Optional[int]=7_6_8					,  lowerCAmelCase_ :		Dict=1_2_8					,  lowerCAmelCase_ :		Union[str, Any]=1_2					,  lowerCAmelCase_ :		Optional[Any]=1_2					,  lowerCAmelCase_ :		Any=8					,  lowerCAmelCase_ :		Optional[int]=3_0_7_2					,  lowerCAmelCase_ :		List[str]="gelu_new"					,  lowerCAmelCase_ :		List[str]=0.1					,  lowerCAmelCase_ :		List[Any]=0.1					,  lowerCAmelCase_ :		Any=5_1_2					,  lowerCAmelCase_ :		Any=2					,  lowerCAmelCase_ :		Dict=0.02					,  lowerCAmelCase_ :		int=1e-12					,  lowerCAmelCase_ :		Union[str, Any]=2_5_6					,  lowerCAmelCase_ :		str=1_0					,  lowerCAmelCase_ :		Tuple=1e-3					,  lowerCAmelCase_ :		str=5					,  lowerCAmelCase_ :		str=3_2_0					,  lowerCAmelCase_ :		Union[str, Any]=1_3_3_5_3_7_1_8					,  lowerCAmelCase_ :		str=5_0_0_0					,  lowerCAmelCase_ :		Any=1					,  lowerCAmelCase_ :		str=0					,  lowerCAmelCase_ :		Tuple=2					,  **lowerCAmelCase_ :		int					,  )							->						str:
     super().__init__(pad_token_id=SCREAMING_SNAKE_CASE_					,  bos_token_id=SCREAMING_SNAKE_CASE_					,  eos_token_id=SCREAMING_SNAKE_CASE_					,  **SCREAMING_SNAKE_CASE_     )

     # Common config
     __lowerCAmelCase								=	vocab_size
     __lowerCAmelCase								=	max_position_embeddings
     __lowerCAmelCase								=	hidden_size
     __lowerCAmelCase								=	retriever_proj_size
     __lowerCAmelCase								=	num_hidden_layers
     __lowerCAmelCase								=	num_attention_heads
     __lowerCAmelCase								=	num_candidates
     __lowerCAmelCase								=	intermediate_size
     __lowerCAmelCase								=	hidden_act
     __lowerCAmelCase								=	hidden_dropout_prob
     __lowerCAmelCase								=	attention_probs_dropout_prob
     __lowerCAmelCase								=	initializer_range
     __lowerCAmelCase								=	type_vocab_size
     __lowerCAmelCase								=	layer_norm_eps

     # Reader config
     __lowerCAmelCase								=	span_hidden_size
     __lowerCAmelCase								=	max_span_width
     __lowerCAmelCase								=	reader_layer_norm_eps
     __lowerCAmelCase								=	reader_beam_size
     __lowerCAmelCase								=	reader_seq_len

     # Retrieval config
     __lowerCAmelCase								=	num_block_records
     __lowerCAmelCase								=	searcher_beam_size





'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_torch_available,
    is_vision_available,
)


A__		:					List[str]												=  {"""configuration_beit""": ["""BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """BeitConfig""", """BeitOnnxConfig"""]}

try:
      if not is_vision_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__		:					str												=  ["""BeitFeatureExtractor"""]
      A__		:					List[str]												=  ["""BeitImageProcessor"""]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__		:					Optional[int]												=  [
          """BEIT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """BeitForImageClassification""",
          """BeitForMaskedImageModeling""",
          """BeitForSemanticSegmentation""",
          """BeitModel""",
          """BeitPreTrainedModel""",
      ]


try:
      if not is_flax_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      A__		:					Any												=  [
          """FlaxBeitForImageClassification""",
          """FlaxBeitForMaskedImageModeling""",
          """FlaxBeitModel""",
          """FlaxBeitPreTrainedModel""",
      ]

if TYPE_CHECKING:
      from .configuration_beit import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BeitConfig, BeitOnnxConfig

      try:
            if not is_vision_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .feature_extraction_beit import BeitFeatureExtractor
            from .image_processing_beit import BeitImageProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_beit import (
                BEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
                BeitForImageClassification,
                BeitForMaskedImageModeling,
                BeitForSemanticSegmentation,
                BeitModel,
                BeitPreTrainedModel,
            )

      try:
            if not is_flax_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_flax_beit import (
                FlaxBeitForImageClassification,
                FlaxBeitForMaskedImageModeling,
                FlaxBeitModel,
                FlaxBeitPreTrainedModel,
            )


else:
      import sys

      A__		:					Optional[Any]												=  _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






