
from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE				:str									=							{
    "configuration_gpt_bigcode": ["GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTBigCodeConfig"],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					SCREAMING_SNAKE_CASE				:int									=							[
					    "GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST",
					    "GPTBigCodeForSequenceClassification",
					    "GPTBigCodeForTokenClassification",
					    "GPTBigCodeForCausalLM",
					    "GPTBigCodeModel",
					    "GPTBigCodePreTrainedModel",
					]

if TYPE_CHECKING:
					from .configuration_gpt_bigcode import GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_gpt_bigcode import (
										    GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST,
										    GPTBigCodeForCausalLM,
										    GPTBigCodeForSequenceClassification,
										    GPTBigCodeForTokenClassification,
										    GPTBigCodeModel,
										    GPTBigCodePreTrainedModel,
										)


else:
					import sys

					SCREAMING_SNAKE_CASE				:List[Any]									=							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)




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 							UpperCamelCase_( )       ->		List[Any]:
    _lowercase			:				int 						=						ArgumentParser('Transformers CLI tool'				,					usage='transformers-cli <command> [<args>]'					)
    _lowercase			:				Optional[Any] 						=						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
    _lowercase			:				Any 						=						parser.parse_args()

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

    # Run
    _lowercase			:				Optional[int] 						=						args.func(lowerCamelCase_					)
    service.run()


if __name__ == "__main__":
 main()


