

'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


A_	= {
    "configuration_encodec": [
        "ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP",
        "EncodecConfig",
    ],
    "feature_extraction_encodec": ["EncodecFeatureExtractor"],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				A_	= [
				    "ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST",
				    "EncodecModel",
				    "EncodecPreTrainedModel",
				]

if TYPE_CHECKING:
				from .configuration_encodec import (
				    ENCODEC_PRETRAINED_CONFIG_ARCHIVE_MAP,
				    EncodecConfig,
				)
				from .feature_extraction_encodec import EncodecFeatureExtractor

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_encodec import (
								    ENCODEC_PRETRAINED_MODEL_ARCHIVE_LIST,
								    EncodecModel,
								    EncodecPreTrainedModel,
								)

else:
				import sys

				A_	= _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)




'''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=lowerCAmelCase__      )
class 							a__(   lowerCAmelCase__      ):


			'''simple docstring'''






			UpperCAmelCase_     :	str						=			field(default='''automatic-speech-recognition'''					,		metadata={'''include_in_asdict_even_if_is_default''': True}      )
			UpperCAmelCase_     :	ClassVar[Features]						=			Features({'''audio''': Audio()}      )
			UpperCAmelCase_     :	ClassVar[Features]						=			Features({'''transcription''': Value('''string'''      )}      )
			UpperCAmelCase_     :	str						=			"audio"
			UpperCAmelCase_     :	str						=			"transcription"



			def 				a_			(  self			,       __lowerCAmelCase):




					"""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]			,       __lowerCAmelCase):
							raise ValueError(f"Column {self.audio_column} is not an Audio type.")
					lowerCAmelCase     =    copy.deepcopy(self)
					lowerCAmelCase     =    self.input_schema.copy()
					lowerCAmelCase     =    features[self.audio_column]
					lowerCAmelCase     =    input_schema
					return task_template







			@property
			def 				a_			(  self):




					"""simple docstring"""


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




