



'''simple docstring'''






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCamelCase__:       Optional[int]							     =      {
    "configuration_wav2vec2_conformer": [
        "WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "Wav2Vec2ConformerConfig",
    ],
}


try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      UpperCamelCase__:       Optional[int]							     =      [
          "WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST",
          "Wav2Vec2ConformerForAudioFrameClassification",
          "Wav2Vec2ConformerForCTC",
          "Wav2Vec2ConformerForPreTraining",
          "Wav2Vec2ConformerForSequenceClassification",
          "Wav2Vec2ConformerForXVector",
          "Wav2Vec2ConformerModel",
          "Wav2Vec2ConformerPreTrainedModel",
      ]

if TYPE_CHECKING:
      from .configuration_wavaveca_conformer import (
          WAV2VEC2_CONFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
          WavaVecaConformerConfig,
      )

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_wavaveca_conformer import (
                WAV2VEC2_CONFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
                WavaVecaConformerForAudioFrameClassification,
                WavaVecaConformerForCTC,
                WavaVecaConformerForPreTraining,
                WavaVecaConformerForSequenceClassification,
                WavaVecaConformerForXVector,
                WavaVecaConformerModel,
                WavaVecaConformerPreTrainedModel,
            )

else:
      import sys

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










'''simple docstring'''






import importlib.metadata
import subprocess
import sys


def 			snake_case_					( _lowerCAmelCase  :						bool = False  )				->       str:
							UpperCAmelCase			:	List[str]										=		False
							if "IPython" in sys.modules:
														UpperCAmelCase			:	Optional[Any]										=		'''google.colab''' in str(sys.modules['''IPython'''].get_ipython()  )

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





