
'''simple docstring'''

import importlib.metadata
import subprocess
import sys







def __A  (    lowerCAmelCase_ = False       ):
     _UpperCAmelCase					:  Any         =    False
     if "IPython" in sys.modules:
          _UpperCAmelCase					:  Optional[int]         =    """google.colab""" in str(sys.modules["""IPython"""].get_ipython()       )

     if in_colab:
          if upgrade:
               _UpperCAmelCase					:  Optional[int]         =    ["""pip""", """install""", """-U""", """torch"""]
               subprocess.run(lowerCAmelCase_ ,       check=lowerCAmelCase_       )
          # get the current version of torch
          _UpperCAmelCase					:  Union[str, Any]         =    importlib.metadata.version("""torch"""       )
          _UpperCAmelCase					:  List[Any]         =    torch_version[: torch_version.rindex("""."""       )]
          _UpperCAmelCase					:  Tuple         =    f"https://storage.googleapis.com/tpu-pytorch/wheels/colab/torch_xla-{torch_version_trunc}-cp37-cp37m-linux_x86_64.whl"
          _UpperCAmelCase					:  Tuple         =    ["""pip""", """install""", xla_wheel]
          subprocess.run(lowerCAmelCase_ ,       check=lowerCAmelCase_       )
     else:
          raise RuntimeError("""`install_xla` utility works only on google colab."""       )










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__snake_case			:			Optional[int]			   =   {"""configuration_sew_d""": ["""SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP""", """SEWDConfig"""]}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					__snake_case			:			List[Any]			   =   [
					    """SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """SEWDForCTC""",
					    """SEWDForSequenceClassification""",
					    """SEWDModel""",
					    """SEWDPreTrainedModel""",
					]

if TYPE_CHECKING:
					from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_sew_d import (
										    SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST,
										    SEWDForCTC,
										    SEWDForSequenceClassification,
										    SEWDModel,
										    SEWDPreTrainedModel,
										)


else:
					import sys

					__snake_case			:			Dict			   =   _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)





