

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


_lowerCAmelCase  :      Any			 =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 __UpperCamelCase     (				_lowerCAmelCase		):






					'''simple docstring'''



					__magic_name__        =   "realm"





					def __init__(				self				,      lowerCamelCase__=3_0_5_2_2				,      lowerCamelCase__=7_6_8				,      lowerCamelCase__=1_2_8				,      lowerCamelCase__=1_2				,      lowerCamelCase__=1_2				,      lowerCamelCase__=8				,      lowerCamelCase__=3_0_7_2				,      lowerCamelCase__="gelu_new"				,      lowerCamelCase__=0.1				,      lowerCamelCase__=0.1				,      lowerCamelCase__=5_1_2				,      lowerCamelCase__=2				,      lowerCamelCase__=0.02				,      lowerCamelCase__=1e-12				,      lowerCamelCase__=2_5_6				,      lowerCamelCase__=1_0				,      lowerCamelCase__=1e-3				,      lowerCamelCase__=5				,      lowerCamelCase__=3_2_0				,      lowerCamelCase__=1_3_3_5_3_7_1_8				,      lowerCamelCase__=5_0_0_0				,      lowerCamelCase__=1				,      lowerCamelCase__=0				,      lowerCamelCase__=2				,      **lowerCamelCase__				,      ):
						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
						UpperCAmelCase__:	Optional[int]									= vocab_size
						UpperCAmelCase__:	List[Any]									= max_position_embeddings
						UpperCAmelCase__:	Optional[int]									= hidden_size
						UpperCAmelCase__:	Dict									= retriever_proj_size
						UpperCAmelCase__:	Dict									= num_hidden_layers
						UpperCAmelCase__:	Tuple									= num_attention_heads
						UpperCAmelCase__:	List[Any]									= num_candidates
						UpperCAmelCase__:	Tuple									= intermediate_size
						UpperCAmelCase__:	List[str]									= hidden_act
						UpperCAmelCase__:	Any									= hidden_dropout_prob
						UpperCAmelCase__:	List[Any]									= attention_probs_dropout_prob
						UpperCAmelCase__:	Tuple									= initializer_range
						UpperCAmelCase__:	str									= type_vocab_size
						UpperCAmelCase__:	Optional[int]									= layer_norm_eps

						# Reader config
						UpperCAmelCase__:	Dict									= span_hidden_size
						UpperCAmelCase__:	Any									= max_span_width
						UpperCAmelCase__:	Dict									= reader_layer_norm_eps
						UpperCAmelCase__:	Dict									= reader_beam_size
						UpperCAmelCase__:	Tuple									= reader_seq_len

						# Retrieval config
						UpperCAmelCase__:	int									= num_block_records
						UpperCAmelCase__:	List[Any]									= searcher_beam_size




"""simple docstring"""







from typing import TYPE_CHECKING

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


UpperCamelCase     =							{
    """configuration_perceiver""": ["""PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP""", """PerceiverConfig""", """PerceiverOnnxConfig"""],
    """tokenization_perceiver""": ["""PerceiverTokenizer"""],
}

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			UpperCamelCase     =							["""PerceiverFeatureExtractor"""]
			UpperCamelCase     =							["""PerceiverImageProcessor"""]

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			UpperCamelCase     =							[
			    """PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST""",
			    """PerceiverForImageClassificationConvProcessing""",
			    """PerceiverForImageClassificationFourier""",
			    """PerceiverForImageClassificationLearned""",
			    """PerceiverForMaskedLM""",
			    """PerceiverForMultimodalAutoencoding""",
			    """PerceiverForOpticalFlow""",
			    """PerceiverForSequenceClassification""",
			    """PerceiverLayer""",
			    """PerceiverModel""",
			    """PerceiverPreTrainedModel""",
			]


if TYPE_CHECKING:
			from .configuration_perceiver import PERCEIVER_PRETRAINED_CONFIG_ARCHIVE_MAP, PerceiverConfig, PerceiverOnnxConfig
			from .tokenization_perceiver import PerceiverTokenizer

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .feature_extraction_perceiver import PerceiverFeatureExtractor
						from .image_processing_perceiver import PerceiverImageProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_perceiver import (
						    PERCEIVER_PRETRAINED_MODEL_ARCHIVE_LIST,
						    PerceiverForImageClassificationConvProcessing,
						    PerceiverForImageClassificationFourier,
						    PerceiverForImageClassificationLearned,
						    PerceiverForMaskedLM,
						    PerceiverForMultimodalAutoencoding,
						    PerceiverForOpticalFlow,
						    PerceiverForSequenceClassification,
						    PerceiverLayer,
						    PerceiverModel,
						    PerceiverPreTrainedModel,
						)

else:
			import sys

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




