


import inspect
import unittest

from transformers import MobileViTVaConfig
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, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
		import torch

		from transformers import MobileViTVaForImageClassification, MobileViTVaForSemanticSegmentation, MobileViTVaModel
		from transformers.models.mobilevitva.modeling_mobilevitva import (
		    MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST,
		    make_divisible,
		)


if is_vision_available():
		from PIL import Image

		from transformers import MobileViTImageProcessor



class 						_UpperCAmelCase      (     lowercase							):






		def _snake_case		(						self				:     Dict):
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						self.config_class(**self.inputs_dict)
				self.parent.assertTrue(hasattr(UpperCAmelCase   ,  "width_multiplier"))




class 						_UpperCAmelCase      :






		def __init__(						self				:     Union[str, Any]   ,  UpperCAmelCase				:     Tuple   ,  UpperCAmelCase				:     Tuple=13   ,  UpperCAmelCase				:     Any=64   ,  UpperCAmelCase				:     int=2   ,  UpperCAmelCase				:     int=3   ,  UpperCAmelCase				:     str="swish"   ,  UpperCAmelCase				:     Any=3   ,  UpperCAmelCase				:     List[Any]=32   ,  UpperCAmelCase				:     Any=0.1   ,  UpperCAmelCase				:     Union[str, Any]=0.02   ,  UpperCAmelCase				:     Any=True   ,  UpperCAmelCase				:     int=True   ,  UpperCAmelCase				:     Dict=10   ,  UpperCAmelCase				:     Tuple=None   ,  UpperCAmelCase				:     Optional[int]=0.25   ,  UpperCAmelCase				:     int=0.0   ,  UpperCAmelCase				:     List[str]=0.0   ,  ):
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						parent
				SCREAMING_SNAKE_CASE_				:Any				     =						batch_size
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						image_size
				SCREAMING_SNAKE_CASE_				:int				     =						patch_size
				SCREAMING_SNAKE_CASE_				:Dict				     =						num_channels
				SCREAMING_SNAKE_CASE_				:Tuple				     =						make_divisible(5_12 * width_multiplier   ,  divisor=8)
				SCREAMING_SNAKE_CASE_				:str				     =						hidden_act
				SCREAMING_SNAKE_CASE_				:List[str]				     =						conv_kernel_size
				SCREAMING_SNAKE_CASE_				:Tuple				     =						output_stride
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						classifier_dropout_prob
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						use_labels
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						is_training
				SCREAMING_SNAKE_CASE_				:List[str]				     =						num_labels
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						initializer_range
				SCREAMING_SNAKE_CASE_				:Dict				     =						scope
				SCREAMING_SNAKE_CASE_				:Tuple				     =						width_multiplier
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						ffn_dropout
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						attn_dropout






		def _snake_case		(						self				:     Tuple):
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size])

				SCREAMING_SNAKE_CASE_				:str				     =						None
				SCREAMING_SNAKE_CASE_				:Dict				     =						None
				if self.use_labels:
						SCREAMING_SNAKE_CASE_				:str				     =						ids_tensor([self.batch_size]   ,  self.num_labels)
						SCREAMING_SNAKE_CASE_				:int				     =						ids_tensor([self.batch_size, self.image_size, self.image_size]   ,  self.num_labels)

				SCREAMING_SNAKE_CASE_				:List[str]				     =						self.get_config()

				return config, pixel_values, labels, pixel_labels






		def _snake_case		(						self				:     Union[str, Any]):
				return MobileViTVaConfig(
				    image_size=self.image_size   ,  patch_size=self.patch_size   ,  num_channels=self.num_channels   ,  hidden_act=self.hidden_act   ,  conv_kernel_size=self.conv_kernel_size   ,  output_stride=self.output_stride   ,  classifier_dropout_prob=self.classifier_dropout_prob   ,  initializer_range=self.initializer_range   ,  width_multiplier=self.width_multiplier   ,  ffn_dropout=self.ffn_dropout_prob   ,  attn_dropout=self.attn_dropout_prob   ,  )






		def _snake_case		(						self				:     Any   ,  UpperCAmelCase				:     str   ,  UpperCAmelCase				:     List[str]   ,  UpperCAmelCase				:     Any   ,  UpperCAmelCase				:     Optional[Any]):
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						MobileViTVaModel(config=UpperCAmelCase)
				model.to(UpperCAmelCase)
				model.eval()
				SCREAMING_SNAKE_CASE_				:Any				     =						model(UpperCAmelCase)
				self.parent.assertEqual(
				    result.last_hidden_state.shape   ,  (
				        self.batch_size,
				        self.last_hidden_size,
				        self.image_size // self.output_stride,
				        self.image_size // self.output_stride,
				    )   ,  )






		def _snake_case		(						self				:     Optional[int]   ,  UpperCAmelCase				:     List[str]   ,  UpperCAmelCase				:     Any   ,  UpperCAmelCase				:     str   ,  UpperCAmelCase				:     Dict):
				SCREAMING_SNAKE_CASE_				:Optional[int]				     =						self.num_labels
				SCREAMING_SNAKE_CASE_				:int				     =						MobileViTVaForImageClassification(UpperCAmelCase)
				model.to(UpperCAmelCase)
				model.eval()
				SCREAMING_SNAKE_CASE_				:Tuple				     =						model(UpperCAmelCase   ,  labels=UpperCAmelCase)
				self.parent.assertEqual(result.logits.shape   ,  (self.batch_size, self.num_labels))






		def _snake_case		(						self				:     Optional[Any]   ,  UpperCAmelCase				:     Tuple   ,  UpperCAmelCase				:     Optional[Any]   ,  UpperCAmelCase				:     Optional[int]   ,  UpperCAmelCase				:     str):
				SCREAMING_SNAKE_CASE_				:str				     =						self.num_labels
				SCREAMING_SNAKE_CASE_				:Optional[int]				     =						MobileViTVaForSemanticSegmentation(UpperCAmelCase)
				model.to(UpperCAmelCase)
				model.eval()
				SCREAMING_SNAKE_CASE_				:Dict				     =						model(UpperCAmelCase)
				self.parent.assertEqual(
				    result.logits.shape   ,  (
				        self.batch_size,
				        self.num_labels,
				        self.image_size // self.output_stride,
				        self.image_size // self.output_stride,
				    )   ,  )
				SCREAMING_SNAKE_CASE_				:List[str]				     =						model(UpperCAmelCase   ,  labels=UpperCAmelCase)
				self.parent.assertEqual(
				    result.logits.shape   ,  (
				        self.batch_size,
				        self.num_labels,
				        self.image_size // self.output_stride,
				        self.image_size // self.output_stride,
				    )   ,  )







		def _snake_case		(						self				:     Union[str, Any]):
				SCREAMING_SNAKE_CASE_				:str				     =						self.prepare_config_and_inputs()
				SCREAMING_SNAKE_CASE_     ,				SCREAMING_SNAKE_CASE_     ,				SCREAMING_SNAKE_CASE_     ,				SCREAMING_SNAKE_CASE_				:Optional[int]				     =						config_and_inputs
				SCREAMING_SNAKE_CASE_				:Optional[int]				     =						{"pixel_values": pixel_values}
				return config, inputs_dict




@require_torch
class 						_UpperCAmelCase      (     lowercase		,		lowercase		,		unittest.TestCase							):
		lowerCamelCase_	:			List[str]       			=  (
		    (MobileViTVaModel, MobileViTVaForImageClassification, MobileViTVaForSemanticSegmentation)
		    if is_torch_available()
		    else ()
		)

		lowerCamelCase_	:			Optional[Any]       			=  (
		    {
		        """feature-extraction""": MobileViTVaModel,
		        """image-classification""": MobileViTVaForImageClassification,
		        """image-segmentation""": MobileViTVaForSemanticSegmentation,
		    }
		    if is_torch_available()
		    else {}
		)

		lowerCamelCase_	:			List[str]       			=  False
		lowerCamelCase_	:			Optional[Any]       			=  False
		lowerCamelCase_	:			Tuple       			=  False
		lowerCamelCase_	:			Optional[Any]       			=  False






		def _snake_case		(						self				:     Tuple):
				SCREAMING_SNAKE_CASE_				:int				     =						MobileViTVaModelTester(self)
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						MobileViTVaConfigTester(self   ,  config_class=UpperCAmelCase   ,  has_text_modality=UpperCAmelCase)






		def _snake_case		(						self				:     List[str]):
				self.config_tester.run_common_tests()






		@unittest.skip(reason="MobileViTV2 does not use inputs_embeds")
		def _snake_case		(						self				:     Union[str, Any]):
				pass






		@unittest.skip(reason="MobileViTV2 does not support input and output embeddings")
		def _snake_case		(						self				:     Dict):
				pass






		@unittest.skip(reason="MobileViTV2 does not output attentions")
		def _snake_case		(						self				:     Dict):
				pass






		@require_torch_multi_gpu
		@unittest.skip(reason="Got `CUDA error: misaligned address` for tests after this one being run.")
		def _snake_case		(						self				:     List[str]):
				pass






		@unittest.skip("Will be fixed soon by reducing the size of the model used for common tests.")
		def _snake_case		(						self				:     Union[str, Any]):
				pass






		def _snake_case		(						self				:     str):
				SCREAMING_SNAKE_CASE_     ,				SCREAMING_SNAKE_CASE_				:str				     =						self.model_tester.prepare_config_and_inputs_for_common()

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

						SCREAMING_SNAKE_CASE_				:Dict				     =						["pixel_values"]
						self.assertListEqual(arg_names[:1]   ,  UpperCAmelCase)






		def _snake_case		(						self				:     Any):
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						self.model_tester.prepare_config_and_inputs()
				self.model_tester.create_and_check_model(*UpperCAmelCase)






		def _snake_case		(						self				:     str):
				def check_hidden_states_output(UpperCAmelCase				:     Any   ,  UpperCAmelCase				:     int   ,  UpperCAmelCase				:     int):
						SCREAMING_SNAKE_CASE_				:Tuple				     =						model_class(UpperCAmelCase)
						model.to(UpperCAmelCase)
						model.eval()

						with torch.no_grad():
								SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						model(**self._prepare_for_class(UpperCAmelCase   ,  UpperCAmelCase))

						SCREAMING_SNAKE_CASE_				:Dict				     =						outputs.hidden_states

						SCREAMING_SNAKE_CASE_				:str				     =						5
						self.assertEqual(len(UpperCAmelCase)   ,  UpperCAmelCase)

						# MobileViTV2's feature maps are of shape (batch_size, num_channels, height, width)
						# with the width and height being successively divided by 2.
						SCREAMING_SNAKE_CASE_				:List[str]				     =						2
						for i in range(len(UpperCAmelCase)):
								self.assertListEqual(
								    list(hidden_states[i].shape[-2:])   ,  [self.model_tester.image_size // divisor, self.model_tester.image_size // divisor]   ,  )
								divisor *= 2

						self.assertEqual(self.model_tester.output_stride   ,  divisor // 2)

				SCREAMING_SNAKE_CASE_     ,				SCREAMING_SNAKE_CASE_				:str				     =						self.model_tester.prepare_config_and_inputs_for_common()

				for model_class in self.all_model_classes:
						SCREAMING_SNAKE_CASE_				:int				     =						True
						check_hidden_states_output(UpperCAmelCase   ,  UpperCAmelCase   ,  UpperCAmelCase)

						# check that output_hidden_states also work using config
						del inputs_dict["output_hidden_states"]
						SCREAMING_SNAKE_CASE_				:str				     =						True

						check_hidden_states_output(UpperCAmelCase   ,  UpperCAmelCase   ,  UpperCAmelCase)






		def _snake_case		(						self				:     Optional[int]):
				SCREAMING_SNAKE_CASE_				:str				     =						self.model_tester.prepare_config_and_inputs()
				self.model_tester.create_and_check_for_image_classification(*UpperCAmelCase)






		def _snake_case		(						self				:     str):
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						self.model_tester.prepare_config_and_inputs()
				self.model_tester.create_and_check_for_semantic_segmentation(*UpperCAmelCase)







		@slow
		def _snake_case		(						self				:     Any):
				for model_name in MOBILEVITV2_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
						SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						MobileViTVaModel.from_pretrained(UpperCAmelCase)
						self.assertIsNotNone(UpperCAmelCase)




def     lowercase	(    ):



		'''simple docstring'''




		SCREAMING_SNAKE_CASE_				:Tuple				     =						Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png" )
		return image



@require_torch
@require_vision
class 						_UpperCAmelCase      (     unittest.TestCase							):






		@cached_property
		def _snake_case		(						self				:     Any):
				return (
				    MobileViTImageProcessor.from_pretrained("apple/mobilevitv2-1.0-imagenet1k-256")
				    if is_vision_available()
				    else None
				)






		@slow
		def _snake_case		(						self				:     Dict):
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						MobileViTVaForImageClassification.from_pretrained("apple/mobilevitv2-1.0-imagenet1k-256").to(
				    UpperCAmelCase)

				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						self.default_image_processor
				SCREAMING_SNAKE_CASE_				:List[str]				     =						prepare_img()
				SCREAMING_SNAKE_CASE_				:Dict				     =						image_processor(images=UpperCAmelCase   ,  return_tensors="pt").to(UpperCAmelCase)

				# forward pass
				with torch.no_grad():
						SCREAMING_SNAKE_CASE_				:List[str]				     =						model(**UpperCAmelCase)

				# verify the logits
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						torch.Size((1, 10_00))
				self.assertEqual(outputs.logits.shape   ,  UpperCAmelCase)

				SCREAMING_SNAKE_CASE_				:Dict				     =						torch.tensor([-1.6_336E00, -7.3_204E-02, -5.1_883E-01]).to(UpperCAmelCase)

				self.assertTrue(torch.allclose(outputs.logits[0, :3]   ,  UpperCAmelCase   ,  atol=1E-4))






		@slow
		def _snake_case		(						self				:     Optional[int]):
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						MobileViTVaForSemanticSegmentation.from_pretrained("shehan97/mobilevitv2-1.0-voc-deeplabv3")
				SCREAMING_SNAKE_CASE_				:Any				     =						model.to(UpperCAmelCase)

				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						MobileViTImageProcessor.from_pretrained("shehan97/mobilevitv2-1.0-voc-deeplabv3")

				SCREAMING_SNAKE_CASE_				:Dict				     =						prepare_img()
				SCREAMING_SNAKE_CASE_				:int				     =						image_processor(images=UpperCAmelCase   ,  return_tensors="pt").to(UpperCAmelCase)

				# forward pass
				with torch.no_grad():
						SCREAMING_SNAKE_CASE_				:int				     =						model(**UpperCAmelCase)
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						outputs.logits

				# verify the logits
				SCREAMING_SNAKE_CASE_				:List[str]				     =						torch.Size((1, 21, 32, 32))
				self.assertEqual(logits.shape   ,  UpperCAmelCase)

				SCREAMING_SNAKE_CASE_				:Tuple				     =						torch.tensor(
				    [
				        [[7.0863, 7.1525, 6.8201], [6.6931, 6.8770, 6.8933], [6.2978, 7.0366, 6.9636]],
				        [[-3.7134, -3.6712, -3.6675], [-3.5825, -3.3549, -3.4777], [-3.3435, -3.3979, -3.2857]],
				        [[-2.9329, -2.8003, -2.7369], [-3.0564, -2.4780, -2.0207], [-2.6889, -1.9298, -1.7640]],
				    ]   ,  device=UpperCAmelCase   ,  )

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







		@slow
		def _snake_case		(						self				:     Any):
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						MobileViTVaForSemanticSegmentation.from_pretrained("shehan97/mobilevitv2-1.0-voc-deeplabv3")
				SCREAMING_SNAKE_CASE_				:Optional[int]				     =						model.to(UpperCAmelCase)

				SCREAMING_SNAKE_CASE_				:Tuple				     =						MobileViTImageProcessor.from_pretrained("shehan97/mobilevitv2-1.0-voc-deeplabv3")

				SCREAMING_SNAKE_CASE_				:str				     =						prepare_img()
				SCREAMING_SNAKE_CASE_				:List[str]				     =						image_processor(images=UpperCAmelCase   ,  return_tensors="pt").to(UpperCAmelCase)

				# forward pass
				with torch.no_grad():
						SCREAMING_SNAKE_CASE_				:str				     =						model(**UpperCAmelCase)

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

				SCREAMING_SNAKE_CASE_				:Tuple				     =						image_processor.post_process_semantic_segmentation(outputs=UpperCAmelCase   ,  target_sizes=[(50, 60)])
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						torch.Size((50, 60))
				self.assertEqual(segmentation[0].shape   ,  UpperCAmelCase)

				SCREAMING_SNAKE_CASE_				:Tuple				     =						image_processor.post_process_semantic_segmentation(outputs=UpperCAmelCase)
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						torch.Size((32, 32))
				self.assertEqual(segmentation[0].shape   ,  UpperCAmelCase)










from collections import Counter
from pathlib import Path
from typing import Optional, Tuple

import yaml



class 						_UpperCAmelCase      (     yaml.SafeLoader							):






		def _snake_case		(						self				:     Dict   ,  UpperCAmelCase				:     Union[str, Any]):
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						[self.constructed_objects[key_node] for key_node, _ in node.value]
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						[tuple(UpperCAmelCase) if isinstance(UpperCAmelCase   ,  UpperCAmelCase) else key for key in keys]
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						Counter(UpperCAmelCase)
				SCREAMING_SNAKE_CASE_				:str				     =						[key for key in counter if counter[key] > 1]
				if duplicate_keys:
						raise TypeError(F"Got duplicate yaml keys: {duplicate_keys}")







		def _snake_case		(						self				:     int   ,  UpperCAmelCase				:     Union[str, Any]   ,  UpperCAmelCase				:     Union[str, Any]=False):
				SCREAMING_SNAKE_CASE_				:Optional[int]				     =						super().construct_mapping(UpperCAmelCase   ,  deep=UpperCAmelCase)
				self._check_no_duplicates_on_constructed_node(UpperCAmelCase)
				return mapping




def     lowercase	(    a ):



		'''simple docstring'''




		SCREAMING_SNAKE_CASE_				:Any				     =						list(readme_content.splitlines() )
		if full_content and full_content[0] == "---" and "---" in full_content[1:]:
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						full_content[1:].index("---" ) + 1
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						"\n".join(full_content[1:sep_idx] )
				return yamlblock, "\n".join(full_content[sep_idx + 1 :] )

		return None, "\n".join(a )



class 						_UpperCAmelCase      (     lowercase							):
		# class attributes
		lowerCamelCase_	:			List[Any]       			=  {"""train_eval_index"""}  # train-eval-index in the YAML metadata






		@classmethod
		def _snake_case		(						cls				:     Optional[int]   ,  UpperCAmelCase				:     Path):
				with open(UpperCAmelCase   ,  encoding="utf-8") as readme_file:
						SCREAMING_SNAKE_CASE_     ,				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						_split_yaml_from_readme(readme_file.read())
				if yaml_string is not None:
						return cls.from_yaml_string(UpperCAmelCase)
				else:
						return cls()






		def _snake_case		(						self				:     Dict   ,  UpperCAmelCase				:     Path):
				if path.exists():
						with open(UpperCAmelCase   ,  encoding="utf-8") as readme_file:
								SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						readme_file.read()
				else:
						SCREAMING_SNAKE_CASE_				:List[str]				     =						None
				SCREAMING_SNAKE_CASE_				:List[Any]				     =						self._to_readme(UpperCAmelCase)
				with open(UpperCAmelCase   ,  "w"   ,  encoding="utf-8") as readme_file:
						readme_file.write(UpperCAmelCase)






		def _snake_case		(						self				:     Union[str, Any]   ,  UpperCAmelCase				:     Optional[str] = None):
				if readme_content is not None:
						SCREAMING_SNAKE_CASE_     ,				SCREAMING_SNAKE_CASE_				:List[str]				     =						_split_yaml_from_readme(UpperCAmelCase)
						SCREAMING_SNAKE_CASE_				:int				     =						"---\n" + self.to_yaml_string() + "---\n" + content
				else:
						SCREAMING_SNAKE_CASE_				:Any				     =						"---\n" + self.to_yaml_string() + "---\n"
				return full_content






		@classmethod
		def _snake_case		(						cls				:     List[str]   ,  UpperCAmelCase				:     str):
				SCREAMING_SNAKE_CASE_				:Optional[Any]				     =						yaml.load(UpperCAmelCase   ,  Loader=_NoDuplicateSafeLoader) or {}

				# Convert the YAML keys to DatasetMetadata fields
				SCREAMING_SNAKE_CASE_				:Union[str, Any]				     =						{
				    (key.replace("-"   ,  "_") if key.replace("-"   ,  "_") in cls._FIELDS_WITH_DASHES else key): value
				    for key, value in metadata_dict.items()
				}
				return cls(**UpperCAmelCase)







		def _snake_case		(						self				:     str):
				return yaml.safe_dump(
				    {
				        (key.replace("_"   ,  "-") if key in self._FIELDS_WITH_DASHES else key): value
				        for key, value in self.items()
				    }   ,  sort_keys=UpperCAmelCase   ,  allow_unicode=UpperCAmelCase   ,  encoding="utf-8"   ,  ).decode("utf-8")




SCREAMING_SNAKE_CASE__     					=			{
    "image-classification": [],
    "translation": [],
    "image-segmentation": [],
    "fill-mask": [],
    "automatic-speech-recognition": [],
    "token-classification": [],
    "sentence-similarity": [],
    "audio-classification": [],
    "question-answering": [],
    "summarization": [],
    "zero-shot-classification": [],
    "table-to-text": [],
    "feature-extraction": [],
    "other": [],
    "multiple-choice": [],
    "text-classification": [],
    "text-to-image": [],
    "text2text-generation": [],
    "zero-shot-image-classification": [],
    "tabular-classification": [],
    "tabular-regression": [],
    "image-to-image": [],
    "tabular-to-text": [],
    "unconditional-image-generation": [],
    "text-retrieval": [],
    "text-to-speech": [],
    "object-detection": [],
    "audio-to-audio": [],
    "text-generation": [],
    "conversational": [],
    "table-question-answering": [],
    "visual-question-answering": [],
    "image-to-text": [],
    "reinforcement-learning": [],
    "voice-activity-detection": [],
    "time-series-forecasting": [],
    "document-question-answering": [],
}


if __name__ == "__main__":
		from argparse import ArgumentParser

		SCREAMING_SNAKE_CASE__     					=			ArgumentParser(usage="Validate the yaml metadata block of a README.md file.")
		ap.add_argument("readme_filepath")
		SCREAMING_SNAKE_CASE__     					=			ap.parse_args()

		SCREAMING_SNAKE_CASE__     					=			Path(args.readme_filepath)
		SCREAMING_SNAKE_CASE__     					=			DatasetMetadata.from_readme(readme_filepath)
		print(dataset_metadata)
		dataset_metadata.to_readme(readme_filepath)






