

import argparse

from ...utils.dataclasses import (
    ComputeEnvironment,
    DistributedType,
    DynamoBackend,
    PrecisionType,
    SageMakerDistributedType,
)
from ..menu import BulletMenu


__snake_case			:     List[Any]										=      [
    'EAGER',
    'AOT_EAGER',
    'INDUCTOR',
    'NVFUSER',
    'AOT_NVFUSER',
    'AOT_CUDAGRAPHS',
    'OFI',
    'FX2TRT',
    'ONNXRT',
    'IPEX',
]
def 						__lowerCamelCase	(       __snake_case					:		List[Any],		__snake_case					:		Dict=None,		__snake_case					:		Tuple=None,		__snake_case					:		List[Any]=None	)	->							str:






						"""simple docstring"""





						A__					:       Optional[int]     =True
						while ask_again:
												A__					:       Optional[int]     =input(__snake_case	)
												try:
																		if default is not None and len(__snake_case	) == 0:
																								return default
																		return convert_value(__snake_case	) if convert_value is not None else result
												except Exception:
																		if error_message is not None:
																								print(__snake_case	)
def 						__lowerCamelCase	(       __snake_case					:		Optional[Any],		__snake_case					:		List[str]=[],		__snake_case					:		Optional[Any]=None,		__snake_case					:		int=0	)	->							Any:






						"""simple docstring"""





						A__					:       Dict     =BulletMenu(__snake_case,		__snake_case	)
						A__					:       Union[str, Any]     =menu.run(default_choice=__snake_case	)
						return convert_value(__snake_case	) if convert_value is not None else result
def 						__lowerCamelCase	(       __snake_case					:		Dict	)	->							Any:






						"""simple docstring"""





						A__					:       Union[str, Any]     =int(__snake_case	)
						return ComputeEnvironment(["""LOCAL_MACHINE""", """AMAZON_SAGEMAKER"""][value]	)
def 						__lowerCamelCase	(       __snake_case					:		List[str]	)	->							List[str]:






						"""simple docstring"""





						A__					:       str     =int(__snake_case	)
						return DistributedType(["""NO""", """MULTI_CPU""", """MULTI_XPU""", """MULTI_GPU""", """MULTI_NPU""", """TPU"""][value]	)
def 						__lowerCamelCase	(       __snake_case					:		Any	)	->							Any:






						"""simple docstring"""





						A__					:       Optional[int]     =int(__snake_case	)
						return DynamoBackend(DYNAMO_BACKENDS[value]	).value
def 						__lowerCamelCase	(       __snake_case					:		List[str]	)	->							Union[str, Any]:






						"""simple docstring"""





						A__					:       Any     =int(__snake_case	)
						return PrecisionType(["""no""", """fp16""", """bf16""", """fp8"""][value]	)
def 						__lowerCamelCase	(       __snake_case					:		List[Any]	)	->							Dict:






						"""simple docstring"""





						A__					:       str     =int(__snake_case	)
						return SageMakerDistributedType(["""NO""", """DATA_PARALLEL""", """MODEL_PARALLEL"""][value]	)
def 						__lowerCamelCase	(       __snake_case					:		Any	)	->							List[str]:






						"""simple docstring"""





						return {"yes": True, "no": False}[value.lower()]



class lowerCamelCase			(  argparse.RawDescriptionHelpFormatter						):



			'''simple docstring'''






			def lowercase__						(				self	:						Optional[int]		,      lowerCAmelCase_	:						Dict		,      lowerCAmelCase_	:						Tuple		,      lowerCAmelCase_	:						List[Any]		,      lowerCAmelCase_	:						Union[str, Any]			)      ->		int:





									'''simple docstring'''
									A__					:       List[str]     =super()._format_usage(a__		,      a__		,      a__		,      a__			)
									A__					:       Dict     =usage.replace("""<command> [<args>] """		,      """"""			)
									return usage




'''simple docstring'''



from typing import TYPE_CHECKING

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


__snake_case			:     Any										=      {
    'configuration_audio_spectrogram_transformer': [
        'AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'ASTConfig',
    ]
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__snake_case			:     Optional[int]										=      [
		    'AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
		    'ASTForAudioClassification',
		    'ASTModel',
		    'ASTPreTrainedModel',
		]

try:
		if not is_speech_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__snake_case			:     List[Any]										=      ['ASTFeatureExtractor']

if TYPE_CHECKING:
		from .configuration_audio_spectrogram_transformer import (
		    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP,
		    ASTConfig,
		)

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_audio_spectrogram_transformer import (
				    AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
				    ASTForAudioClassification,
				    ASTModel,
				    ASTPreTrainedModel,
				)

		try:
				if not is_speech_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .feature_extraction_audio_spectrogram_transformer import ASTFeatureExtractor


else:
		import sys

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

