






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_a    :   Tuple        =			{
    """configuration_upernet""": ["""UperNetConfig"""],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _a    :   List[Any]        =			[
     """UperNetForSemanticSegmentation""",
     """UperNetPreTrainedModel""",
 ]


if TYPE_CHECKING:
 from .configuration_upernet import UperNetConfig

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_upernet import UperNetForSemanticSegmentation, UperNetPreTrainedModel


else:
 import sys

 _a    :   Optional[int]        =			_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)











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



