


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


__UpperCamelCase       :       str						       =				logging.get_logger(__name__)

__UpperCamelCase       :       Optional[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       __magic_name__	(     __lowerCAmelCase):
     A:		int			=      "realm"


     def __init__(      self							:     Optional[Any]							,	lowerCamelCase__							:     str=30522							,	lowerCamelCase__							:     Optional[int]=768							,	lowerCamelCase__							:     Dict=128							,	lowerCamelCase__							:     Union[str, Any]=12							,	lowerCamelCase__							:     Any=12							,	lowerCamelCase__							:     Union[str, Any]=8							,	lowerCamelCase__							:     List[str]=3072							,	lowerCamelCase__							:     Any="gelu_new"							,	lowerCamelCase__							:     Optional[int]=0.1							,	lowerCamelCase__							:     Optional[int]=0.1							,	lowerCamelCase__							:     Dict=512							,	lowerCamelCase__							:     str=2							,	lowerCamelCase__							:     Optional[int]=0.02							,	lowerCamelCase__							:     Optional[Any]=1E-1_2							,	lowerCamelCase__							:     int=256							,	lowerCamelCase__							:     int=10							,	lowerCamelCase__							:     Optional[Any]=1E-3							,	lowerCamelCase__							:     List[Any]=5							,	lowerCamelCase__							:     List[str]=320							,	lowerCamelCase__							:     str=13353718							,	lowerCamelCase__							:     Dict=5000							,	lowerCamelCase__							:     Dict=1							,	lowerCamelCase__							:     List[str]=0							,	lowerCamelCase__							:     Tuple=2							,	**lowerCamelCase__							:     Union[str, Any]							,	)  ->      List[str]:





      '''simple docstring'''






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

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

      # Reader config
      UpperCamelCase__					:    Dict          =   span_hidden_size
      UpperCamelCase__					:    int          =   max_span_width
      UpperCamelCase__					:    str          =   reader_layer_norm_eps
      UpperCamelCase__					:    int          =   reader_beam_size
      UpperCamelCase__					:    Optional[Any]          =   reader_seq_len

      # Retrieval config
      UpperCamelCase__					:    Dict          =   num_block_records
      UpperCamelCase__					:    Optional[Any]          =   searcher_beam_size






from typing import TYPE_CHECKING

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


__UpperCamelCase       :       Dict						       =				{
    "configuration_trocr": ["TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP", "TrOCRConfig"],
    "processing_trocr": ["TrOCRProcessor"],
}


try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __UpperCamelCase       :       Optional[int]						       =				[
           "TROCR_PRETRAINED_MODEL_ARCHIVE_LIST",
           "TrOCRForCausalLM",
           "TrOCRPreTrainedModel",
       ]


if TYPE_CHECKING:
       from .configuration_trocr import TROCR_PRETRAINED_CONFIG_ARCHIVE_MAP, TrOCRConfig
       from .processing_trocr import TrOCRProcessor

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_trocr import TROCR_PRETRAINED_MODEL_ARCHIVE_LIST, TrOCRForCausalLM, TrOCRPreTrainedModel

else:
       import sys

       __UpperCamelCase       :       Tuple						       =				_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)


