

"""simple docstring"""




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


__UpperCAmelCase =				logging.get_logger(__name__)

__UpperCAmelCase =				{
    '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      __lowercase			(    __lowerCamelCase					):
		snake_case_				       =       """realm"""

		def __init__(  self		:			Union[str, Any]					,A		:			List[str]=30_522					,A		:			Optional[int]=768					,A		:			Union[str, Any]=128					,A		:			List[str]=12					,A		:			int=12					,A		:			Optional[int]=8					,A		:			Optional[int]=3_072					,A		:			Optional[Any]="gelu_new"					,A		:			Optional[int]=0.1					,A		:			Optional[Any]=0.1					,A		:			List[Any]=512					,A		:			Tuple=2					,A		:			Tuple=0.0_2					,A		:			str=1e-12					,A		:			str=256					,A		:			Any=10					,A		:			Dict=1e-3					,A		:			List[str]=5					,A		:			str=320					,A		:			List[str]=13_353_718					,A		:			Union[str, Any]=5_000					,A		:			Optional[int]=1					,A		:			str=0					,A		:			Optional[Any]=2					,**A		:			Optional[int]					,):






			'''simple docstring'''
			super().__init__(pad_token_id=A					,bos_token_id=A					,eos_token_id=A					,**A    )

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

			# Reader config
			UpperCAmelCase__					:  str					   =					span_hidden_size
			UpperCAmelCase__					:  Any					   =					max_span_width
			UpperCAmelCase__					:  List[str]					   =					reader_layer_norm_eps
			UpperCAmelCase__					:  str					   =					reader_beam_size
			UpperCAmelCase__					:  Tuple					   =					reader_seq_len

			# Retrieval config
			UpperCAmelCase__					:  List[str]					   =					num_block_records
			UpperCAmelCase__					:  Dict					   =					searcher_beam_size








"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__UpperCAmelCase =				{
    'configuration_roberta': ['ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP', 'RobertaConfig', 'RobertaOnnxConfig'],
    'tokenization_roberta': ['RobertaTokenizer'],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase =				['RobertaTokenizerFast']

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase =				[
          'ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST',
          'RobertaForCausalLM',
          'RobertaForMaskedLM',
          'RobertaForMultipleChoice',
          'RobertaForQuestionAnswering',
          'RobertaForSequenceClassification',
          'RobertaForTokenClassification',
          'RobertaModel',
          'RobertaPreTrainedModel',
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase =				[
          'TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST',
          'TFRobertaForCausalLM',
          'TFRobertaForMaskedLM',
          'TFRobertaForMultipleChoice',
          'TFRobertaForQuestionAnswering',
          'TFRobertaForSequenceClassification',
          'TFRobertaForTokenClassification',
          'TFRobertaMainLayer',
          'TFRobertaModel',
          'TFRobertaPreTrainedModel',
      ]

try:
      if not is_flax_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __UpperCAmelCase =				[
          'FlaxRobertaForCausalLM',
          'FlaxRobertaForMaskedLM',
          'FlaxRobertaForMultipleChoice',
          'FlaxRobertaForQuestionAnswering',
          'FlaxRobertaForSequenceClassification',
          'FlaxRobertaForTokenClassification',
          'FlaxRobertaModel',
          'FlaxRobertaPreTrainedModel',
      ]


if TYPE_CHECKING:
      from .configuration_roberta import ROBERTA_PRETRAINED_CONFIG_ARCHIVE_MAP, RobertaConfig, RobertaOnnxConfig
      from .tokenization_roberta import RobertaTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_roberta_fast import RobertaTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_roberta import (
                ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
                RobertaForCausalLM,
                RobertaForMaskedLM,
                RobertaForMultipleChoice,
                RobertaForQuestionAnswering,
                RobertaForSequenceClassification,
                RobertaForTokenClassification,
                RobertaModel,
                RobertaPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_roberta import (
                TF_ROBERTA_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFRobertaForCausalLM,
                TFRobertaForMaskedLM,
                TFRobertaForMultipleChoice,
                TFRobertaForQuestionAnswering,
                TFRobertaForSequenceClassification,
                TFRobertaForTokenClassification,
                TFRobertaMainLayer,
                TFRobertaModel,
                TFRobertaPreTrainedModel,
            )

      try:
            if not is_flax_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_flax_roberta import (
                FlaxRobertaForCausalLM,
                FlaxRobertaForMaskedLM,
                FlaxRobertaForMultipleChoice,
                FlaxRobertaForQuestionAnswering,
                FlaxRobertaForSequenceClassification,
                FlaxRobertaForTokenClassification,
                FlaxRobertaModel,
                FlaxRobertaPreTrainedModel,
            )

else:
      import sys

      __UpperCAmelCase =				_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





