

import operator as op


_lowerCamelCase    :       int        =							"scaler.pt"
_lowerCamelCase    :       Any        =							"pytorch_model"
_lowerCamelCase    :       int        =							"random_states"
_lowerCamelCase    :       str        =							"optimizer"
_lowerCamelCase    :       Dict        =							"scheduler"
_lowerCamelCase    :       Optional[int]        =							"pytorch_model.bin"
_lowerCamelCase    :       List[str]        =							"pytorch_model.bin.index.json"
_lowerCamelCase    :       Optional[Any]        =							"model.safetensors"
_lowerCamelCase    :       Optional[Any]        =							"model.safetensors.index.json"
_lowerCamelCase    :       List[Any]        =							"1.10.2"
_lowerCamelCase    :       List[Any]        =							"py38"
_lowerCamelCase    :       str        =							"4.17.0"
_lowerCamelCase    :       str        =							["ml.p3.16xlarge", "ml.p3dn.24xlarge", "ml.p4dn.24xlarge"]
_lowerCamelCase    :       Optional[Any]        =							["FULL_SHARD", "SHARD_GRAD_OP", "NO_SHARD", "HYBRID_SHARD", "HYBRID_SHARD_ZERO2"]
_lowerCamelCase    :       Optional[int]        =							["TRANSFORMER_BASED_WRAP", "SIZE_BASED_WRAP", "NO_WRAP"]
_lowerCamelCase    :       str        =							["BACKWARD_PRE", "BACKWARD_POST", "NO_PREFETCH"]
_lowerCamelCase    :       Optional[Any]        =							["FULL_STATE_DICT", "LOCAL_STATE_DICT", "SHARDED_STATE_DICT"]
_lowerCamelCase    :       str        =							"2.0.1"
_lowerCamelCase    :       Union[str, Any]        =							["pdsh", "standard", "openmpi", "mvapich"]
_lowerCamelCase    :       Optional[Any]        =							["default", "reduce-overhead", "max-autotune"]

_lowerCamelCase    :       Tuple        =							{">": op.gt, ">=": op.ge, "==": op.eq, "!=": op.ne, "<=": op.le, "<": op.lt}

# These are the args for `torch.distributed.launch` for pytorch < 1.9
_lowerCamelCase    :       Optional[Any]        =							[
    "nnodes",
    "nproc_per_node",
    "rdzv_backend",
    "rdzv_endpoint",
    "rdzv_id",
    "rdzv_conf",
    "standalone",
    "max_restarts",
    "monitor_interval",
    "start_method",
    "role",
    "module",
    "m",
    "no_python",
    "run_path",
    "log_dir",
    "r",
    "redirects",
    "t",
    "tee",
    "node_rank",
    "master_addr",
    "master_port",
]

_lowerCamelCase    :       List[str]        =							["DEEPSPEED", "MULTI_GPU", "FSDP", "MEGATRON_LM"]
_lowerCamelCase    :       List[str]        =							["DEEPSPEED", "MULTI_XPU", "FSDP"]








from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_lowerCamelCase    :       str        =							{"configuration_xlnet": ["XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP", "XLNetConfig"]}

try:
     if not is_sentencepiece_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _lowerCamelCase    :       List[Any]        =							["XLNetTokenizer"]

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _lowerCamelCase    :       Optional[Any]        =							["XLNetTokenizerFast"]

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _lowerCamelCase    :       Dict        =							[
         "XLNET_PRETRAINED_MODEL_ARCHIVE_LIST",
         "XLNetForMultipleChoice",
         "XLNetForQuestionAnswering",
         "XLNetForQuestionAnsweringSimple",
         "XLNetForSequenceClassification",
         "XLNetForTokenClassification",
         "XLNetLMHeadModel",
         "XLNetModel",
         "XLNetPreTrainedModel",
         "load_tf_weights_in_xlnet",
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     _lowerCamelCase    :       Union[str, Any]        =							[
         "TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST",
         "TFXLNetForMultipleChoice",
         "TFXLNetForQuestionAnsweringSimple",
         "TFXLNetForSequenceClassification",
         "TFXLNetForTokenClassification",
         "TFXLNetLMHeadModel",
         "TFXLNetMainLayer",
         "TFXLNetModel",
         "TFXLNetPreTrainedModel",
     ]


if TYPE_CHECKING:
     from .configuration_xlnet import XLNET_PRETRAINED_CONFIG_ARCHIVE_MAP, XLNetConfig

     try:
          if not is_sentencepiece_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_xlnet import XLNetTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_xlnet_fast import XLNetTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_xlnet import (
              XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
              XLNetForMultipleChoice,
              XLNetForQuestionAnswering,
              XLNetForQuestionAnsweringSimple,
              XLNetForSequenceClassification,
              XLNetForTokenClassification,
              XLNetLMHeadModel,
              XLNetModel,
              XLNetPreTrainedModel,
              load_tf_weights_in_xlnet,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_xlnet import (
              TF_XLNET_PRETRAINED_MODEL_ARCHIVE_LIST,
              TFXLNetForMultipleChoice,
              TFXLNetForQuestionAnsweringSimple,
              TFXLNetForSequenceClassification,
              TFXLNetForTokenClassification,
              TFXLNetLMHeadModel,
              TFXLNetMainLayer,
              TFXLNetModel,
              TFXLNetPreTrainedModel,
          )

else:
     import sys

     _lowerCamelCase    :       Optional[Any]        =							_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





