




"""simple docstring"""



from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE    =	{
    "configuration_mega": ["MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP", "MegaConfig", "MegaOnnxConfig"],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      SCREAMING_SNAKE_CASE    =	[
          "MEGA_PRETRAINED_MODEL_ARCHIVE_LIST",
          "MegaForCausalLM",
          "MegaForMaskedLM",
          "MegaForMultipleChoice",
          "MegaForQuestionAnswering",
          "MegaForSequenceClassification",
          "MegaForTokenClassification",
          "MegaModel",
          "MegaPreTrainedModel",
      ]

if TYPE_CHECKING:
      from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_mega import (
                MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
                MegaForCausalLM,
                MegaForMaskedLM,
                MegaForMultipleChoice,
                MegaForQuestionAnswering,
                MegaForSequenceClassification,
                MegaForTokenClassification,
                MegaModel,
                MegaPreTrainedModel,
            )

else:
      import sys

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











"""simple docstring"""



from argparse import ArgumentParser

from .env import EnvironmentCommand







def   _SCREAMING_SNAKE_CASE       (							)						->		List[Any]:
 A__	=    ArgumentParser("Diffusers CLI tool"      ,			usage="diffusers-cli <command> [<args>]"						)
 A__	=    parser.add_subparsers(help="diffusers-cli command helpers"						)

 # Register commands
 EnvironmentCommand.register_subcommand(lowercase_						)

 # Let's go
 A__	=    parser.parse_args()

 if not hasattr(lowercase_      ,			"func"						):
  parser.print_help()
  exit(1						)

 # Run
 A__	=    args.func(lowercase_						)
 service.run()


if __name__ == "__main__":
      main()





