
"""simple docstring"""





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


_a		       =							logging.get_logger(__name__)

_a		       =							{
    '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 A_	(lowercase__      ):




  '''simple docstring'''
  SCREAMING_SNAKE_CASE__			:						Union[str, Any]       =		"""realm"""







  def __init__(		self				,   lowercase_=3_0522				,   lowercase_=768				,   lowercase_=128				,   lowercase_=12				,   lowercase_=12				,   lowercase_=8				,   lowercase_=3072				,   lowercase_="gelu_new"				,   lowercase_=0.1				,   lowercase_=0.1				,   lowercase_=512				,   lowercase_=2				,   lowercase_=0.02				,   lowercase_=1E-1_2				,   lowercase_=256				,   lowercase_=10				,   lowercase_=1E-3				,   lowercase_=5				,   lowercase_=320				,   lowercase_=1335_3718				,   lowercase_=5000				,   lowercase_=1				,   lowercase_=0				,   lowercase_=2				,   **lowercase_				,   ):

     """simple docstring"""
     super().__init__(pad_token_id=lowercase_				,   bos_token_id=lowercase_				,   eos_token_id=lowercase_				,   **lowercase_  )

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

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

     # Retrieval config
     UpperCAmelCase_					:					Union[str, Any]			     =    num_block_records
     UpperCAmelCase_					:					Optional[Any]			     =    searcher_beam_size







'''simple docstring'''






import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin



class 							lowercase       (  unittest.TestCase					,					_lowerCamelCase				):


 """simple docstring"""


 def _snake_case (							self							)		->   Any:
        _UpperCAmelCase  :						int			     = load_tool("""text-classification"""							)
        self.tool.setup()
        _UpperCAmelCase  :						Tuple			     = load_tool("""text-classification"""  ,remote=a_							)







 def _snake_case (							self							)		->   Union[str, Any]:
        _UpperCAmelCase  :						Tuple			     = self.tool("""That's quite cool"""  ,["""positive""", """negative"""]							)
        self.assertEqual(a_  ,"""positive"""							)







 def _snake_case (							self							)		->   Any:
        _UpperCAmelCase  :						Dict			     = self.remote_tool("""That's quite cool"""  ,["""positive""", """negative"""]							)
        self.assertEqual(a_  ,"""positive"""							)







 def _snake_case (							self							)		->   str:
        _UpperCAmelCase  :						List[Any]			     = self.tool(text="""That's quite cool"""  ,labels=["""positive""", """negative"""]							)
        self.assertEqual(a_  ,"""positive"""							)







 def _snake_case (							self							)		->   Union[str, Any]:
        _UpperCAmelCase  :						Any			     = self.remote_tool(text="""That's quite cool"""  ,labels=["""positive""", """negative"""]							)
        self.assertEqual(a_  ,"""positive"""							)



