from typing import TYPE_CHECKING

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


A_:   Union[str, Any]   =      {
    '''configuration_groupvit''': [
        '''GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''GroupViTConfig''',
        '''GroupViTOnnxConfig''',
        '''GroupViTTextConfig''',
        '''GroupViTVisionConfig''',
    ],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				A_:   Tuple   =      [
				    '''GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''GroupViTModel''',
				    '''GroupViTPreTrainedModel''',
				    '''GroupViTTextModel''',
				    '''GroupViTVisionModel''',
				]

try:
				if not is_tf_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				A_:   Tuple   =      [
				    '''TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
				    '''TFGroupViTModel''',
				    '''TFGroupViTPreTrainedModel''',
				    '''TFGroupViTTextModel''',
				    '''TFGroupViTVisionModel''',
				]

if TYPE_CHECKING:
				from .configuration_groupvit import (
				    GROUPVIT_PRETRAINED_CONFIG_ARCHIVE_MAP,
				    GroupViTConfig,
				    GroupViTOnnxConfig,
				    GroupViTTextConfig,
				    GroupViTVisionConfig,
				)

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_groupvit import (
								    GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    GroupViTModel,
								    GroupViTPreTrainedModel,
								    GroupViTTextModel,
								    GroupViTVisionModel,
								)

				try:
								if not is_tf_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_tf_groupvit import (
								    TF_GROUPVIT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    TFGroupViTModel,
								    TFGroupViTPreTrainedModel,
								    TFGroupViTTextModel,
								    TFGroupViTVisionModel,
								)

else:
				import sys

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






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 						lowerCamelCase_							(					lowerCAmelCase__					):



					'''simple docstring'''







					__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 A   (					self			,							snake_case_    ) ->      Any:







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






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







								'''simple docstring'''

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


