

import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin




class 							lowerCAmelCase__  (	unittest.TestCase					,							UpperCamelCase						):







					def  _lowercase			(       self      :     List[Any]):
											A__	:							Optional[Any]						    = load_tool("text-classification")
											self.tool.setup()
											A__	:							Any						    = load_tool("text-classification"			,		remote=_A)







					def  _lowercase			(       self      :     List[Any]):
											A__	:							Optional[Any]						    = self.tool("That's quite cool"			,		["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     List[str]):
											A__	:							Any						    = self.remote_tool("That's quite cool"			,		["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     Optional[Any]):
											A__	:							List[str]						    = self.tool(text="That's quite cool"			,		labels=["positive", "negative"])
											self.assertEqual(_A			,		"positive")







					def  _lowercase			(       self      :     Tuple):
											A__	:							Union[str, Any]						    = self.remote_tool(text="That's quite cool"			,		labels=["positive", "negative"])
											self.assertEqual(_A			,		"positive")




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__       (					)		->		List[Any]:







						"""simple docstring"""

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

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

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

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

						# Run
						A__	:							Any						    = args.func(__lowercase       )
						service.run()


if __name__ == "__main__":
		main()