





'''simple docstring'''

from typing import TYPE_CHECKING

from ..utils import _LazyModule


UpperCAmelCase					:		Optional[Any]		=							{
    'config': [
        'EXTERNAL_DATA_FORMAT_SIZE_LIMIT',
        'OnnxConfig',
        'OnnxConfigWithPast',
        'OnnxSeq2SeqConfigWithPast',
        'PatchingSpec',
    ],
    'convert': ['export', 'validate_model_outputs'],
    'features': ['FeaturesManager'],
    'utils': ['ParameterFormat', 'compute_serialized_parameters_size'],
}


if TYPE_CHECKING:
   from .config import (
       EXTERNAL_DATA_FORMAT_SIZE_LIMIT,
       OnnxConfig,
       OnnxConfigWithPast,
       OnnxSeqaSeqConfigWithPast,
       PatchingSpec,
   )
   from .convert import export, validate_model_outputs
   from .features import FeaturesManager
   from .utils import ParameterFormat, compute_serialized_parameters_size

else:
   import sys

   UpperCAmelCase					:		str		=							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)











'''simple docstring'''

from argparse import ArgumentParser

from .add_new_model import AddNewModelCommand
from .add_new_model_like import AddNewModelLikeCommand
from .convert import ConvertCommand
from .download import DownloadCommand
from .env import EnvironmentCommand
from .lfs import LfsCommands
from .pt_to_tf import PTtoTFCommand
from .run import RunCommand
from .serving import ServeCommand
from .user import UserCommands




def    _a    (							):





      """simple docstring"""



      _snake_case		:	List[Any]					     =     ArgumentParser('''Transformers CLI tool'''			,      usage='''transformers-cli <command> [<args>]'''	)
      _snake_case		:	List[str]					     =     parser.add_subparsers(help='''transformers-cli command helpers'''	)

      # Register commands
      ConvertCommand.register_subcommand(lowerCAmelCase_	)
      DownloadCommand.register_subcommand(lowerCAmelCase_	)
      EnvironmentCommand.register_subcommand(lowerCAmelCase_	)
      RunCommand.register_subcommand(lowerCAmelCase_	)
      ServeCommand.register_subcommand(lowerCAmelCase_	)
      UserCommands.register_subcommand(lowerCAmelCase_	)
      AddNewModelCommand.register_subcommand(lowerCAmelCase_	)
      AddNewModelLikeCommand.register_subcommand(lowerCAmelCase_	)
      LfsCommands.register_subcommand(lowerCAmelCase_	)
      PTtoTFCommand.register_subcommand(lowerCAmelCase_	)

      # Let's go
      _snake_case		:	str					     =     parser.parse_args()

      if not hasattr(lowerCAmelCase_			,      '''func'''	):
            parser.print_help()
            exit(1	)

      # Run
      _snake_case		:	Union[str, Any]					     =     args.func(lowerCAmelCase_	)
      service.run()


if __name__ == "__main__":
   main()


