





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						()       ->     Optional[int]:
    lowercase__			    =						ArgumentParser('Transformers CLI tool'	,		usage='transformers-cli <command> [<args>]'	)
    lowercase__			    =						parser.add_subparsers(help='transformers-cli command helpers'	)

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

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

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

    # Run
    lowercase__			    =						args.func(_SCREAMING_SNAKE_CASE	)
    service.run()


if __name__ == "__main__":
      main()









from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


lowercase_					     =	{
    """configuration_squeezebert""": [
        """SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """SqueezeBertConfig""",
        """SqueezeBertOnnxConfig""",
    ],
    """tokenization_squeezebert""": ["""SqueezeBertTokenizer"""],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_					     =	["""SqueezeBertTokenizerFast"""]

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_					     =	[
          """SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """SqueezeBertForMaskedLM""",
          """SqueezeBertForMultipleChoice""",
          """SqueezeBertForQuestionAnswering""",
          """SqueezeBertForSequenceClassification""",
          """SqueezeBertForTokenClassification""",
          """SqueezeBertModel""",
          """SqueezeBertModule""",
          """SqueezeBertPreTrainedModel""",
      ]


if TYPE_CHECKING:
      from .configuration_squeezebert import (
          SQUEEZEBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
          SqueezeBertConfig,
          SqueezeBertOnnxConfig,
      )
      from .tokenization_squeezebert import SqueezeBertTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_squeezebert_fast import SqueezeBertTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_squeezebert import (
                SQUEEZEBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
                SqueezeBertForMaskedLM,
                SqueezeBertForMultipleChoice,
                SqueezeBertForQuestionAnswering,
                SqueezeBertForSequenceClassification,
                SqueezeBertForTokenClassification,
                SqueezeBertModel,
                SqueezeBertModule,
                SqueezeBertPreTrainedModel,
            )

else:
      import sys

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


