


'''simple docstring'''

import operator as op


lowerCAmelCase				:Optional[Any]        =      "scaler.pt"
lowerCAmelCase				:Dict        =      "pytorch_model"
lowerCAmelCase				:Any        =      "random_states"
lowerCAmelCase				:List[Any]        =      "optimizer"
lowerCAmelCase				:List[str]        =      "scheduler"
lowerCAmelCase				:List[Any]        =      "pytorch_model.bin"
lowerCAmelCase				:int        =      "pytorch_model.bin.index.json"
lowerCAmelCase				:str        =      "model.safetensors"
lowerCAmelCase				:int        =      "model.safetensors.index.json"
lowerCAmelCase				:str        =      "1.10.2"
lowerCAmelCase				:List[Any]        =      "py38"
lowerCAmelCase				:str        =      "4.17.0"
lowerCAmelCase				:List[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				:str        =      ["TRANSFORMER_BASED_WRAP", "SIZE_BASED_WRAP", "NO_WRAP"]
lowerCAmelCase				:Tuple        =      ["BACKWARD_PRE", "BACKWARD_POST", "NO_PREFETCH"]
lowerCAmelCase				:Union[str, Any]        =      ["FULL_STATE_DICT", "LOCAL_STATE_DICT", "SHARDED_STATE_DICT"]
lowerCAmelCase				:Optional[int]        =      "2.0.1"
lowerCAmelCase				:List[str]        =      ["pdsh", "standard", "openmpi", "mvapich"]
lowerCAmelCase				:Optional[int]        =      ["default", "reduce-overhead", "max-autotune"]

lowerCAmelCase				:str        =      {">": 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				:Tuple        =      [
    "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				:Any        =      ["DEEPSPEED", "MULTI_GPU", "FSDP", "MEGATRON_LM"]
lowerCAmelCase				:str        =      ["DEEPSPEED", "MULTI_XPU", "FSDP"]



'''simple docstring'''

from typing import TYPE_CHECKING

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


lowerCAmelCase				:str        =      {
    '''configuration_vision_encoder_decoder''': ['''VisionEncoderDecoderConfig''', '''VisionEncoderDecoderOnnxConfig''']
}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase				:List[str]        =      ['''VisionEncoderDecoderModel''']

try:
							if not is_tf_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase				:List[str]        =      ['''TFVisionEncoderDecoderModel''']

try:
							if not is_flax_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							lowerCAmelCase				:Optional[Any]        =      ['''FlaxVisionEncoderDecoderModel''']

if TYPE_CHECKING:
							from .configuration_vision_encoder_decoder import VisionEncoderDecoderConfig, VisionEncoderDecoderOnnxConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_vision_encoder_decoder import VisionEncoderDecoderModel

							try:
														if not is_tf_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_tf_vision_encoder_decoder import TFVisionEncoderDecoderModel

							try:
														if not is_flax_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_flax_vision_encoder_decoder import FlaxVisionEncoderDecoderModel

else:
							import sys

							lowerCAmelCase				:Tuple        =      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)