
import inspect
import unittest

from datasets import load_dataset
from packaging import version

from transformers import BeitConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_torch_multi_gpu, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, _config_zero_init, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
      import torch
      from torch import nn

      from transformers import (
          MODEL_MAPPING,
          BeitForImageClassification,
          BeitForMaskedImageModeling,
          BeitForSemanticSegmentation,
          BeitModel,
      )
      from transformers.models.beit.modeling_beit import BEIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
      import PIL
      from PIL import Image

      from transformers import BeitImageProcessor





class 							A__		:
      def __init__(      self    ,  __magic_name__    ,  __magic_name__=1_0_0    ,  __magic_name__=1_3    ,  __magic_name__=3_0    ,  __magic_name__=2    ,  __magic_name__=3    ,  __magic_name__=True    ,  __magic_name__=True    ,  __magic_name__=3_2    ,  __magic_name__=4    ,  __magic_name__=4    ,  __magic_name__=3_7    ,  __magic_name__="gelu"    ,  __magic_name__=0.1    ,  __magic_name__=0.1    ,  __magic_name__=1_0    ,  __magic_name__=0.02    ,  __magic_name__=3    ,  __magic_name__=None    ,  __magic_name__=[0, 1, 2, 3]    ,  ):
       lowerCamelCase		:	Optional[int]							=      parent
       lowerCamelCase		:	Union[str, Any]							=      1_0_0
       lowerCamelCase		:	int							=      batch_size
       lowerCamelCase		:	Any							=      image_size
       lowerCamelCase		:	List[str]							=      patch_size
       lowerCamelCase		:	Union[str, Any]							=      num_channels
       lowerCamelCase		:	Optional[int]							=      is_training
       lowerCamelCase		:	Optional[Any]							=      use_labels
       lowerCamelCase		:	List[Any]							=      hidden_size
       lowerCamelCase		:	int							=      num_hidden_layers
       lowerCamelCase		:	Union[str, Any]							=      num_attention_heads
       lowerCamelCase		:	Union[str, Any]							=      intermediate_size
       lowerCamelCase		:	List[Any]							=      hidden_act
       lowerCamelCase		:	Optional[Any]							=      hidden_dropout_prob
       lowerCamelCase		:	Dict							=      attention_probs_dropout_prob
       lowerCamelCase		:	str							=      type_sequence_label_size
       lowerCamelCase		:	List[Any]							=      initializer_range
       lowerCamelCase		:	Tuple							=      scope
       lowerCamelCase		:	Any							=      out_indices
       lowerCamelCase		:	Optional[Any]							=      num_labels

       # in BeiT, the seq length equals the number of patches + 1 (we add 1 for the [CLS] token)
       lowerCamelCase		:	int							=      (image_size // patch_size) ** 2
       lowerCamelCase		:	List[str]							=      num_patches + 1
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Union[str, Any]							=      floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]      )

       lowerCamelCase		:	Optional[Any]							=      None
       lowerCamelCase		:	List[Any]							=      None
       if self.use_labels:
        lowerCamelCase		:	str							=      ids_tensor([self.batch_size]    ,  self.type_sequence_label_size      )
        lowerCamelCase		:	Optional[int]							=      ids_tensor([self.batch_size, self.image_size, self.image_size]    ,  self.num_labels      )

       lowerCamelCase		:	Tuple							=      self.get_config()

       return config, pixel_values, labels, pixel_labels
      def 						UpperCamelCase__							(      self      ):
       return BeitConfig(
           vocab_size=self.vocab_size    ,  image_size=self.image_size    ,  patch_size=self.patch_size    ,  num_channels=self.num_channels    ,  hidden_size=self.hidden_size    ,  num_hidden_layers=self.num_hidden_layers    ,  num_attention_heads=self.num_attention_heads    ,  intermediate_size=self.intermediate_size    ,  hidden_act=self.hidden_act    ,  hidden_dropout_prob=self.hidden_dropout_prob    ,  attention_probs_dropout_prob=self.attention_probs_dropout_prob    ,  is_decoder=__magic_name__    ,  initializer_range=self.initializer_range    ,  out_indices=self.out_indices    ,  )
      def 						UpperCamelCase__							(      self    ,  __magic_name__    ,  __magic_name__    ,  __magic_name__    ,  __magic_name__      ):
       lowerCamelCase		:	List[Any]							=      BeitModel(config=__magic_name__      )
       model.to(__magic_name__      )
       model.eval()
       lowerCamelCase		:	Union[str, Any]							=      model(__magic_name__      )
       self.parent.assertEqual(result.last_hidden_state.shape    ,  (self.batch_size, self.seq_length, self.hidden_size)      )
      def 						UpperCamelCase__							(      self    ,  __magic_name__    ,  __magic_name__    ,  __magic_name__    ,  __magic_name__      ):
       lowerCamelCase		:	str							=      BeitForMaskedImageModeling(config=__magic_name__      )
       model.to(__magic_name__      )
       model.eval()
       lowerCamelCase		:	Optional[int]							=      model(__magic_name__      )
       self.parent.assertEqual(result.logits.shape    ,  (self.batch_size, self.seq_length - 1, self.vocab_size)      )
      def 						UpperCamelCase__							(      self    ,  __magic_name__    ,  __magic_name__    ,  __magic_name__    ,  __magic_name__      ):
       lowerCamelCase		:	Any							=      self.type_sequence_label_size
       lowerCamelCase		:	Tuple							=      BeitForImageClassification(__magic_name__      )
       model.to(__magic_name__      )
       model.eval()
       lowerCamelCase		:	Any							=      model(__magic_name__    ,  labels=__magic_name__      )
       self.parent.assertEqual(result.logits.shape    ,  (self.batch_size, self.type_sequence_label_size)      )

       # test greyscale images
       lowerCamelCase		:	List[str]							=      1
       lowerCamelCase		:	Optional[Any]							=      BeitForImageClassification(__magic_name__      )
       model.to(__magic_name__      )
       model.eval()

       lowerCamelCase		:	Tuple							=      floats_tensor([self.batch_size, 1, self.image_size, self.image_size]      )
       lowerCamelCase		:	List[Any]							=      model(__magic_name__    ,  labels=__magic_name__      )
       self.parent.assertEqual(result.logits.shape    ,  (self.batch_size, self.type_sequence_label_size)      )
      def 						UpperCamelCase__							(      self    ,  __magic_name__    ,  __magic_name__    ,  __magic_name__    ,  __magic_name__      ):
       lowerCamelCase		:	Any							=      self.num_labels
       lowerCamelCase		:	List[str]							=      BeitForSemanticSegmentation(__magic_name__      )
       model.to(__magic_name__      )
       model.eval()
       lowerCamelCase		:	int							=      model(__magic_name__      )
       self.parent.assertEqual(
           result.logits.shape    ,  (self.batch_size, self.num_labels, self.image_size * 2, self.image_size * 2)      )
       lowerCamelCase		:	Union[str, Any]							=      model(__magic_name__    ,  labels=__magic_name__      )
       self.parent.assertEqual(
           result.logits.shape    ,  (self.batch_size, self.num_labels, self.image_size * 2, self.image_size * 2)      )






      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	List[str]							=      self.prepare_config_and_inputs()
       lowerCamelCase			,    lowerCamelCase			,    lowerCamelCase			,    lowerCamelCase		:	int							=      config_and_inputs
       lowerCamelCase		:	Optional[int]							=      {"""pixel_values""": pixel_values}
       return config, inputs_dict





@require_torch
class 							A__		(	__SCREAMING_SNAKE_CASE  ,   __SCREAMING_SNAKE_CASE  ,   unittest.TestCase):
      _UpperCAmelCase				:    Optional[int]           =			(
          (BeitModel, BeitForImageClassification, BeitForMaskedImageModeling, BeitForSemanticSegmentation)
          if is_torch_available()
          else ()
      )
      _UpperCAmelCase				:    Union[str, Any]           =			(
          {
              """feature-extraction""": BeitModel,
              """image-classification""": BeitForImageClassification,
              """image-segmentation""": BeitForSemanticSegmentation,
          }
          if is_torch_available()
          else {}
      )

      _UpperCAmelCase				:    int           =			False
      _UpperCAmelCase				:    Dict           =			False
      _UpperCAmelCase				:    Optional[int]           =			False
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	str							=      BeitModelTester(self      )
       lowerCamelCase		:	int							=      ConfigTester(self    ,  config_class=__magic_name__    ,  has_text_modality=__magic_name__    ,  hidden_size=3_7      )
      def 						UpperCamelCase__							(      self      ):
       self.config_tester.run_common_tests()
      @unittest.skip(reason="""BEiT does not use inputs_embeds"""      )
      def 						UpperCamelCase__							(      self      ):
       pass
      @require_torch_multi_gpu
      @unittest.skip(reason="""BEiT has some layers using `add_module` which doesn't work well with `nn.DataParallel`"""      )
      def 						UpperCamelCase__							(      self      ):
       pass
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase			,    lowerCamelCase		:	int							=      self.model_tester.prepare_config_and_inputs_for_common()

       for model_class in self.all_model_classes:
        lowerCamelCase		:	Optional[Any]							=      model_class(__magic_name__      )
        self.assertIsInstance(model.get_input_embeddings()    ,  (nn.Module)      )
        lowerCamelCase		:	Tuple							=      model.get_output_embeddings()
        self.assertTrue(x is None or isinstance(__magic_name__    ,  nn.Linear      )      )
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase			,    lowerCamelCase		:	Optional[int]							=      self.model_tester.prepare_config_and_inputs_for_common()

       for model_class in self.all_model_classes:
        lowerCamelCase		:	List[str]							=      model_class(__magic_name__      )
        lowerCamelCase		:	List[Any]							=      inspect.signature(model.forward      )
        # signature.parameters is an OrderedDict => so arg_names order is deterministic
        lowerCamelCase		:	List[Any]							=      [*signature.parameters.keys()]

        lowerCamelCase		:	Dict							=      ["""pixel_values"""]
        self.assertListEqual(arg_names[:1]    ,  __magic_name__      )
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	List[Any]							=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_model(*__magic_name__      )
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Optional[int]							=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_for_masked_lm(*__magic_name__      )
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Optional[int]							=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_for_image_classification(*__magic_name__      )
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Union[str, Any]							=      self.model_tester.prepare_config_and_inputs()
       self.model_tester.create_and_check_for_semantic_segmentation(*__magic_name__      )
      def 						UpperCamelCase__							(      self      ):
       if not self.model_tester.is_training:
        return

       lowerCamelCase			,    lowerCamelCase		:	Tuple							=      self.model_tester.prepare_config_and_inputs_for_common()
       lowerCamelCase		:	str							=      True

       for model_class in self.all_model_classes:
        # we don't test BeitForMaskedImageModeling
        if model_class in [*get_values(__magic_name__      ), BeitForMaskedImageModeling]:
         continue

        lowerCamelCase		:	str							=      model_class(__magic_name__      )
        model.to(__magic_name__      )
        model.train()
        lowerCamelCase		:	int							=      self._prepare_for_class(__magic_name__    ,  __magic_name__    ,  return_labels=__magic_name__      )
        lowerCamelCase		:	Any							=      model(**__magic_name__      ).loss
        loss.backward()
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase			,    lowerCamelCase		:	Optional[Any]							=      self.model_tester.prepare_config_and_inputs_for_common()
       if not self.model_tester.is_training:
        return

       lowerCamelCase		:	List[str]							=      False
       lowerCamelCase		:	Union[str, Any]							=      True

       for model_class in self.all_model_classes:
        # we don't test BeitForMaskedImageModeling
        if (
            model_class in [*get_values(__magic_name__      ), BeitForMaskedImageModeling]
            or not model_class.supports_gradient_checkpointing
        ):
         continue

        lowerCamelCase		:	Tuple							=      model_class(__magic_name__      )
        model.gradient_checkpointing_enable()
        model.to(__magic_name__      )
        model.train()
        lowerCamelCase		:	int							=      self._prepare_for_class(__magic_name__    ,  __magic_name__    ,  return_labels=__magic_name__      )
        lowerCamelCase		:	Any							=      model(**__magic_name__      ).loss
        loss.backward()
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase			,    lowerCamelCase		:	Optional[Any]							=      self.model_tester.prepare_config_and_inputs_for_common()

       lowerCamelCase		:	Union[str, Any]							=      _config_zero_init(__magic_name__      )
       for model_class in self.all_model_classes:
        lowerCamelCase		:	Optional[int]							=      model_class(config=__magic_name__      )
        for name, param in model.named_parameters():
         # we skip lambda parameters as these require special initial values
         # determined by config.layer_scale_init_value
         if "lambda" in name:
          continue
         if param.requires_grad:
          self.assertIn(
              ((param.data.mean() * 1e9).round() / 1e9).item()    ,  [0.0, 1.0]    ,  msg=F'''Parameter {name} of model {model_class} seems not properly initialized'''    ,  )






      @slow
      def 						UpperCamelCase__							(      self      ):
       for model_name in BEIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
        lowerCamelCase		:	Tuple							=      BeitModel.from_pretrained(__magic_name__      )
        self.assertIsNotNone(__magic_name__      )





def     _a					(						):
 lowerCamelCase		:	Optional[Any]							=      Image.open("""./tests/fixtures/tests_samples/COCO/000000039769.png"""							)
 return image





@require_torch
@require_vision
class 							A__		(	unittest.TestCase):
      @cached_property
      def 						UpperCamelCase__							(      self      ):
       return BeitImageProcessor.from_pretrained("""microsoft/beit-base-patch16-224"""      ) if is_vision_available() else None
      @slow
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Optional[Any]							=      BeitForMaskedImageModeling.from_pretrained("""microsoft/beit-base-patch16-224-pt22k"""      ).to(__magic_name__      )

       lowerCamelCase		:	List[str]							=      self.default_image_processor
       lowerCamelCase		:	Tuple							=      prepare_img()
       lowerCamelCase		:	Dict							=      image_processor(images=__magic_name__    ,  return_tensors="""pt"""      ).pixel_values.to(__magic_name__      )

       # prepare bool_masked_pos
       lowerCamelCase		:	str							=      torch.ones((1, 1_9_6)    ,  dtype=torch.bool      ).to(__magic_name__      )

       # forward pass
       with torch.no_grad():
        lowerCamelCase		:	Tuple							=      model(pixel_values=__magic_name__    ,  bool_masked_pos=__magic_name__      )
       lowerCamelCase		:	List[Any]							=      outputs.logits

       # verify the logits
       lowerCamelCase		:	List[str]							=      torch.Size((1, 1_9_6, 8_1_9_2)      )
       self.assertEqual(logits.shape    ,  __magic_name__      )

       lowerCamelCase		:	str							=      torch.tensor(
           [[-3.2_437, 0.5_072, -13.9_174], [-3.2_456, 0.4_948, -13.9_401], [-3.2_033, 0.5_121, -13.8_550]]      ).to(__magic_name__      )

       self.assertTrue(torch.allclose(logits[bool_masked_pos][:3, :3]    ,  __magic_name__    ,  atol=1e-2      )      )
      @slow
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Optional[Any]							=      BeitForImageClassification.from_pretrained("""microsoft/beit-base-patch16-224"""      ).to(__magic_name__      )

       lowerCamelCase		:	Optional[Any]							=      self.default_image_processor
       lowerCamelCase		:	List[str]							=      prepare_img()
       lowerCamelCase		:	Optional[int]							=      image_processor(images=__magic_name__    ,  return_tensors="""pt"""      ).to(__magic_name__      )

       # forward pass
       with torch.no_grad():
        lowerCamelCase		:	Optional[int]							=      model(**__magic_name__      )
       lowerCamelCase		:	Dict							=      outputs.logits

       # verify the logits
       lowerCamelCase		:	str							=      torch.Size((1, 1_0_0_0)      )
       self.assertEqual(logits.shape    ,  __magic_name__      )

       lowerCamelCase		:	Optional[int]							=      torch.tensor([-1.2_385, -1.0_987, -1.0_108]      ).to(__magic_name__      )

       self.assertTrue(torch.allclose(logits[0, :3]    ,  __magic_name__    ,  atol=1e-4      )      )

       lowerCamelCase		:	str							=      2_8_1
       self.assertEqual(logits.argmax(-1      ).item()    ,  __magic_name__      )
      @slow
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Tuple							=      BeitForImageClassification.from_pretrained("""microsoft/beit-large-patch16-224-pt22k-ft22k"""      ).to(
           __magic_name__      )

       lowerCamelCase		:	List[str]							=      self.default_image_processor
       lowerCamelCase		:	Union[str, Any]							=      prepare_img()
       lowerCamelCase		:	Optional[int]							=      image_processor(images=__magic_name__    ,  return_tensors="""pt"""      ).to(__magic_name__      )

       # forward pass
       with torch.no_grad():
        lowerCamelCase		:	Any							=      model(**__magic_name__      )
       lowerCamelCase		:	str							=      outputs.logits

       # verify the logits
       lowerCamelCase		:	str							=      torch.Size((1, 2_1_8_4_1)      )
       self.assertEqual(logits.shape    ,  __magic_name__      )

       lowerCamelCase		:	Union[str, Any]							=      torch.tensor([1.6_881, -0.2_787, 0.5_901]      ).to(__magic_name__      )

       self.assertTrue(torch.allclose(logits[0, :3]    ,  __magic_name__    ,  atol=1e-4      )      )

       lowerCamelCase		:	Union[str, Any]							=      2_3_9_6
       self.assertEqual(logits.argmax(-1      ).item()    ,  __magic_name__      )
      @slow
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Any							=      BeitForSemanticSegmentation.from_pretrained("""microsoft/beit-base-finetuned-ade-640-640"""      )
       lowerCamelCase		:	Any							=      model.to(__magic_name__      )

       lowerCamelCase		:	Union[str, Any]							=      BeitImageProcessor(do_resize=__magic_name__    ,  size=6_4_0    ,  do_center_crop=__magic_name__      )

       lowerCamelCase		:	Union[str, Any]							=      load_dataset("""hf-internal-testing/fixtures_ade20k"""    ,  split="""test"""      )
       lowerCamelCase		:	Any							=      Image.open(ds[0]["""file"""]      )
       lowerCamelCase		:	Any							=      image_processor(images=__magic_name__    ,  return_tensors="""pt"""      ).to(__magic_name__      )

       # forward pass
       with torch.no_grad():
        lowerCamelCase		:	List[Any]							=      model(**__magic_name__      )
       lowerCamelCase		:	Any							=      outputs.logits

       # verify the logits
       lowerCamelCase		:	Optional[Any]							=      torch.Size((1, 1_5_0, 1_6_0, 1_6_0)      )
       self.assertEqual(logits.shape    ,  __magic_name__      )

       lowerCamelCase		:	Any							=      version.parse(PIL.__version__      ) < version.parse("""9.0.0"""      )

       if is_pillow_less_than_a:
        lowerCamelCase		:	Optional[Any]							=      torch.tensor(
            [
                [[-4.9_225, -2.3_954, -3.0_522], [-2.8_822, -1.0_046, -1.7_561], [-2.9_549, -1.3_228, -2.1_347]],
                [[-5.8_168, -3.4_129, -4.0_778], [-3.8_651, -2.2_214, -3.0_277], [-3.8_356, -2.4_643, -3.3_535]],
                [[-0.0_078, 3.9_952, 4.0_754], [2.9_856, 4.6_944, 5.0_035], [3.2_413, 4.7_813, 4.9_969]],
            ]    ,  device=__magic_name__    ,  )
       else:
        lowerCamelCase		:	Tuple							=      torch.tensor(
            [
                [[-4.8_960, -2.3_688, -3.0_355], [-2.8_478, -0.9_836, -1.7_418], [-2.9_449, -1.3_332, -2.1_456]],
                [[-5.8_081, -3.4_124, -4.1_006], [-3.8_561, -2.2_081, -3.0_323], [-3.8_365, -2.4_601, -3.3_669]],
                [[-0.0_309, 3.9_868, 4.0_540], [2.9_640, 4.6_877, 4.9_976], [3.2_081, 4.7_690, 4.9_942]],
            ]    ,  device=__magic_name__    ,  )

       self.assertTrue(torch.allclose(logits[0, :3, :3, :3]    ,  __magic_name__    ,  atol=1e-4      )      )






      @slow
      def 						UpperCamelCase__							(      self      ):
       lowerCamelCase		:	Optional[Any]							=      BeitForSemanticSegmentation.from_pretrained("""microsoft/beit-base-finetuned-ade-640-640"""      )
       lowerCamelCase		:	Optional[int]							=      model.to(__magic_name__      )

       lowerCamelCase		:	Optional[int]							=      BeitImageProcessor(do_resize=__magic_name__    ,  size=6_4_0    ,  do_center_crop=__magic_name__      )

       lowerCamelCase		:	Union[str, Any]							=      load_dataset("""hf-internal-testing/fixtures_ade20k"""    ,  split="""test"""      )
       lowerCamelCase		:	Optional[Any]							=      Image.open(ds[0]["""file"""]      )
       lowerCamelCase		:	Optional[Any]							=      image_processor(images=__magic_name__    ,  return_tensors="""pt"""      ).to(__magic_name__      )

       # forward pass
       with torch.no_grad():
        lowerCamelCase		:	Union[str, Any]							=      model(**__magic_name__      )

       lowerCamelCase		:	Tuple							=      outputs.logits.detach().cpu()

       lowerCamelCase		:	str							=      image_processor.post_process_semantic_segmentation(outputs=__magic_name__    ,  target_sizes=[(5_0_0, 3_0_0)]      )
       lowerCamelCase		:	int							=      torch.Size((5_0_0, 3_0_0)      )
       self.assertEqual(segmentation[0].shape    ,  __magic_name__      )

       lowerCamelCase		:	Tuple							=      image_processor.post_process_semantic_segmentation(outputs=__magic_name__      )
       lowerCamelCase		:	List[Any]							=      torch.Size((1_6_0, 1_6_0)      )
       self.assertEqual(segmentation[0].shape    ,  __magic_name__      )






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

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





@dataclass(frozen=__SCREAMING_SNAKE_CASE)
class 							A__		(	__SCREAMING_SNAKE_CASE):
      _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 						UpperCamelCase__							(      self    ,  __magic_name__      ):
       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]    ,  __magic_name__      ):
        raise ValueError(F'''Column {self.audio_column} is not an Audio type.'''      )
       lowerCamelCase		:	Optional[Any]							=      copy.deepcopy(self      )
       lowerCamelCase		:	List[Any]							=      self.input_schema.copy()
       lowerCamelCase		:	Tuple							=      features[self.audio_column]
       lowerCamelCase		:	int							=      input_schema
       return task_template






      @property
      def 						UpperCamelCase__							(      self      ):
       return {self.audio_column: "audio", self.transcription_column: "transcription"}




