


'''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    _snake_case  (	)		->       Union[str, Any]:
							lowerCAmelCase__			  =      ArgumentParser('''Transformers CLI tool'''					,       usage='''transformers-cli <command> [<args>]'''			)
							lowerCAmelCase__			  =      parser.add_subparsers(help='''transformers-cli command helpers'''			)

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

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

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

							# Run
							lowerCAmelCase__			  =      args.func(UpperCamelCase_			)
							service.run()


if __name__ == "__main__":
		main()



import os
from distutils.util import strtobool
def      UpperCAmelCase__		(UpperCamelCase_				,UpperCamelCase_							):



     """simple docstring"""






     for e in env_keys:
          snake_case											=							int(os.environ.get(UpperCamelCase_				,-1							)							)
          if val >= 0:
               return val
     return default
def      UpperCAmelCase__		(UpperCamelCase_				,UpperCamelCase_=False							):



     """simple docstring"""






     snake_case											=							os.environ.get(UpperCamelCase_				,str(UpperCamelCase_							)							)
     return strtobool(UpperCamelCase_							) == 1  # As its name indicates `strtobool` actually returns an int...

def      UpperCAmelCase__		(UpperCamelCase_				,UpperCamelCase_="no"							):



     """simple docstring"""






     snake_case											=							os.environ.get(UpperCamelCase_				,str(UpperCamelCase_							)							)
     return value




