

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 			A_      (	__a     :				str		):

				"""simple docstring"""
				return {key.lstrip("""-"""		): value for key, value in zip(unknown_args[::2] ,		unknown_args[1::2]		)}

def 			A_      (	):

				"""simple docstring"""
				a__				      =		ArgumentParser(
				    """HuggingFace Datasets CLI tool""" ,		usage="""datasets-cli <command> [<args>]""" ,		allow_abbrev=__a		)
				a__				      =		parser.add_subparsers(help="""datasets-cli command helpers"""		)
				set_verbosity_info()

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

				# Parse args
				a__      ,			a__				      =		parser.parse_known_args()
				if not hasattr(__a ,		"""func"""		):
								parser.print_help()
								exit(1		)
				a__				      =		parse_unknown_args(__a		)

				# Run
				a__				      =		args.func(__a ,		**__a		)
				service.run()


if __name__ == "__main__":
	main()






from typing import TYPE_CHECKING

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


UpperCAmelCase							 =					{
    """configuration_falcon""": ["""FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP""", """FalconConfig"""],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	UpperCAmelCase							 =					[
	    """FALCON_PRETRAINED_MODEL_ARCHIVE_LIST""",
	    """FalconForCausalLM""",
	    """FalconModel""",
	    """FalconPreTrainedModel""",
	    """FalconForSequenceClassification""",
	    """FalconForTokenClassification""",
	    """FalconForQuestionAnswering""",
	]


if TYPE_CHECKING:
	from .configuration_falcon import FALCON_PRETRAINED_CONFIG_ARCHIVE_MAP, FalconConfig

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_falcon import (
		    FALCON_PRETRAINED_MODEL_ARCHIVE_LIST,
		    FalconForCausalLM,
		    FalconForQuestionAnswering,
		    FalconForSequenceClassification,
		    FalconForTokenClassification,
		    FalconModel,
		    FalconPreTrainedModel,
		)


else:
	import sys

	UpperCAmelCase							 =					_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

