






"""simple docstring"""
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase_							      = logging.get_logger(__name__)

lowerCamelCase_							      = {
    '''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_			(__A	):
	__magic_name__       =							'''realm'''





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

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

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

				# Retrieval config
				UpperCAmelCase_	:					Optional[int]     	=   num_block_records
				UpperCAmelCase_	:					Dict     	=   searcher_beam_size











from __future__ import annotations







class 		_A						:

  def __init__(    self						:	List[str]   ,				lowerCamelCase__						:	Any=None			):
     """simple docstring"""

     __UpperCamelCase	:			Union[str, Any]					=					data
     __UpperCamelCase	:			Union[str, Any]					=					None

  def __repr__(    self						:	int			):
     """simple docstring"""

     __UpperCamelCase	:			Union[str, Any]					=					[]
     __UpperCamelCase	:			Optional[int]					=					self
     while temp:
        string_rep.append(f'{temp.data}'			)
        __UpperCamelCase	:			Dict					=					temp.next
     return "->".join(lowerCamelCase__			)







def 				__lowerCamelCase     (							__lowerCAmelCase							:					list							)     ->  Tuple:
   if not elements_list:
      raise Exception("""The Elements List is empty"""							)

   __UpperCamelCase	:			Dict					=					Node(elements_list[0]							)
   for i in range(1					,							len(__lowerCAmelCase							)							):
      __UpperCamelCase	:			List[str]					=					Node(elements_list[i]							)
      __UpperCamelCase	:			Optional[int]					=					current.next
   return head


def 				__lowerCamelCase     (							__lowerCAmelCase							:					Node							)     ->  None:
   if head_node is not None and isinstance(__lowerCAmelCase					,							__lowerCAmelCase							):
      print_reverse(head_node.next							)
      print(head_node.data							)


def 				__lowerCamelCase     (							)     ->  Union[str, Any]:
   from doctest import testmod

   testmod()

   __UpperCamelCase	:			Any					=					make_linked_list([14, 52, 14, 12, 43]							)
   print("""Linked List:"""							)
   print(__lowerCAmelCase							)
   print("""Elements in Reverse:"""							)
   print_reverse(__lowerCAmelCase							)


if __name__ == "__main__":
       main()



