






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


_a    :   Union[str, Any]        =			logging.get_logger(__name__)

_a    :   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  (  _a		):




      """simple docstring"""



      A          =    '''realm'''
      def __init__(   self    ,	_lowerCAmelCase=30_522    ,	_lowerCAmelCase=768    ,	_lowerCAmelCase=128    ,	_lowerCAmelCase=12    ,	_lowerCAmelCase=12    ,	_lowerCAmelCase=8    ,	_lowerCAmelCase=3_072    ,	_lowerCAmelCase="gelu_new"    ,	_lowerCAmelCase=0.1    ,	_lowerCAmelCase=0.1    ,	_lowerCAmelCase=512    ,	_lowerCAmelCase=2    ,	_lowerCAmelCase=0.02    ,	_lowerCAmelCase=1e-12    ,	_lowerCAmelCase=256    ,	_lowerCAmelCase=10    ,	_lowerCAmelCase=1e-3    ,	_lowerCAmelCase=5    ,	_lowerCAmelCase=320    ,	_lowerCAmelCase=13_353_718    ,	_lowerCAmelCase=5_000    ,	_lowerCAmelCase=1    ,	_lowerCAmelCase=0    ,	_lowerCAmelCase=2    ,	**_lowerCAmelCase    ,	):



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

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

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

          # Retrieval config
          lowerCAmelCase__   :Optional[int]      							=				num_block_records
          lowerCAmelCase__   :Optional[int]      							=				searcher_beam_size











from argparse import ArgumentParser

from datasets.commands.convert import ConvertCommand
from datasets.commands.dummy_data import DummyDataCommand
from datasets.commands.env import EnvironmentCommand
from datasets.commands.run_beam import RunBeamCommand
from datasets.commands.test import TestCommand
from datasets.utils.logging import set_verbosity_info


def 				snake_case__							(							UpperCAmelCase							:  Dict       ):
    return {key.lstrip("-"       ): value for key, value in zip(unknown_args[::2]    ,			unknown_args[1::2]       )}


def 				snake_case__							(							):
    lowerCAmelCase__   :str      							=				ArgumentParser(
        "HuggingFace Datasets CLI tool"    ,			usage="datasets-cli <command> [<args>]"    ,			allow_abbrev=UpperCAmelCase       )
    lowerCAmelCase__   :Any      							=				parser.add_subparsers(help="datasets-cli command helpers"       )
    set_verbosity_info()

    # Register commands
    ConvertCommand.register_subcommand(UpperCAmelCase       )
    EnvironmentCommand.register_subcommand(UpperCAmelCase       )
    TestCommand.register_subcommand(UpperCAmelCase       )
    RunBeamCommand.register_subcommand(UpperCAmelCase       )
    DummyDataCommand.register_subcommand(UpperCAmelCase       )

    # Parse args
    lowerCAmelCase__							,lowerCAmelCase__   :int      							=				parser.parse_known_args()
    if not hasattr(UpperCAmelCase    ,			"func"       ):
        parser.print_help()
        exit(1       )
    lowerCAmelCase__   :Optional[int]      							=				parse_unknown_args(UpperCAmelCase       )

    # Run
    lowerCAmelCase__   :str      							=				args.func(UpperCAmelCase    ,			**UpperCAmelCase       )
    service.run()


if __name__ == "__main__":
 main()



