

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

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





@dataclass(frozen=__magic_name__			)
class        lowerCAmelCase__  (					__magic_name__			):



       '''simple docstring'''







       lowercase_						=    field(default="""audio-classification"""				,							metadata={"""include_in_asdict_even_if_is_default""": True}			)
       lowercase_						=    Features({"""audio""": Audio()}			)
       lowercase_						=    Features({"""labels""": ClassLabel}			)
       lowercase_						=    "audio"
       lowercase_						=    "labels"

       def     __UpperCamelCase     (							self ,   lowercase__     ):







             '''simple docstring'''



             if self.label_column not in features:
                   raise ValueError(f'''Column {self.label_column} is not present in features.'''     )
             if not isinstance(features[self.label_column] ,   lowercase__     ):
                   raise ValueError(f'''Column {self.label_column} is not a ClassLabel.'''     )
             __A    =copy.deepcopy(self     )
             __A    =self.label_schema.copy()
             __A    =features[self.label_column]
             __A    =label_schema
             return task_template


       @property
       def     __UpperCamelCase     (							self     ):







             '''simple docstring'''



             return {
                 self.audio_column: "audio",
                 self.label_column: "labels",
             }





from typing import TYPE_CHECKING

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


_lowerCamelCase      :					int					    =      {
    '''configuration_audio_spectrogram_transformer''': [
        '''AUDIO_SPECTROGRAM_TRANSFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''ASTConfig''',
    ]
}

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

try:
   if not is_speech_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   _lowerCamelCase      :					Optional[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

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


