
import operator as op


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

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

# These are the args for `torch.distributed.launch` for pytorch < 1.9
lowercase__		: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",
]

lowercase__		:Any   =    ["DEEPSPEED", "MULTI_GPU", "FSDP", "MEGATRON_LM"]
lowercase__		:Dict   =    ["DEEPSPEED", "MULTI_XPU", "FSDP"]












from typing import TYPE_CHECKING

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


lowercase  							=					{
    "configuration_tapas": ["TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP", "TapasConfig"],
    "tokenization_tapas": ["TapasTokenizer"],
}

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowercase  							=					[
	    "TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST",
	    "TapasForMaskedLM",
	    "TapasForQuestionAnswering",
	    "TapasForSequenceClassification",
	    "TapasModel",
	    "TapasPreTrainedModel",
	    "load_tf_weights_in_tapas",
	]
try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	lowercase  							=					[
	    "TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST",
	    "TFTapasForMaskedLM",
	    "TFTapasForQuestionAnswering",
	    "TFTapasForSequenceClassification",
	    "TFTapasModel",
	    "TFTapasPreTrainedModel",
	]


if TYPE_CHECKING:
	from .configuration_tapas import TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig
	from .tokenization_tapas import TapasTokenizer

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tapas import (
		    TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TapasForMaskedLM,
		    TapasForQuestionAnswering,
		    TapasForSequenceClassification,
		    TapasModel,
		    TapasPreTrainedModel,
		    load_tf_weights_in_tapas,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_tapas import (
		    TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
		    TFTapasForMaskedLM,
		    TFTapasForQuestionAnswering,
		    TFTapasForSequenceClassification,
		    TFTapasModel,
		    TFTapasPreTrainedModel,
		)


else:
	import sys

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





