


'''simple docstring'''





import copy
from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Audio, Features, Value
from .base import TaskTemplate

@dataclass(frozen=snake_case__  )
class 						A__							(		snake_case__  ):
						UpperCAmelCase             =						field(default="automatic-speech-recognition"   ,     metadata={"include_in_asdict_even_if_is_default": True}  )
						UpperCAmelCase             =						Features({"audio": Audio()}  )
						UpperCAmelCase             =						Features({"transcription": Value("string"  )}  )
						UpperCAmelCase             =						"audio"
						UpperCAmelCase             =						"transcription"




						def 							__UpperCamelCase				(       self					:      List[Any]				,    _a					:      Any  )							->     int:


										"""simple docstring"""





										if self.audio_column not in features:
														raise ValueError(f"Column {self.audio_column} is not present in features."  )
										if not isinstance(features[self.audio_column]				,    UpperCAmelCase_  ):
														raise ValueError(f"Column {self.audio_column} is not an Audio type."  )
										_SCREAMING_SNAKE_CASE			  =copy.deepcopy(self  )
										_SCREAMING_SNAKE_CASE			  =self.input_schema.copy()
										_SCREAMING_SNAKE_CASE			  =features[self.audio_column]
										_SCREAMING_SNAKE_CASE			  =input_schema
										return task_template




						@property
						def 							__UpperCamelCase				(       self					:      List[str]  )							->     Dict[str, str]:


										"""simple docstring"""





										return {self.audio_column: "audio", self.transcription_column: "transcription"}



from typing import TYPE_CHECKING

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


snake_case_						:			Optional[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[Any]													=							[
							    '''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__)