





import unittest

from parameterized import parameterized

from transformers import AutoTokenizer, GPTNeoXConfig, is_torch_available, set_seed
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
     import torch

     from transformers import (
         GPTNeoXForCausalLM,
         GPTNeoXForQuestionAnswering,
         GPTNeoXForSequenceClassification,
         GPTNeoXForTokenClassification,
         GPTNeoXModel,
     )

class      A       :



      def __init__(	self:						List[str]		,  _lowerCAmelCase:						int		,  _lowerCAmelCase:						Optional[Any]=13		,  _lowerCAmelCase:						Tuple=7		,  _lowerCAmelCase:						Optional[int]=True		,  _lowerCAmelCase:						Dict=True		,  _lowerCAmelCase:						int=True		,  _lowerCAmelCase:						Optional[int]=True		,  _lowerCAmelCase:						int=99		,  _lowerCAmelCase:						Optional[Any]=64		,  _lowerCAmelCase:						Any=5		,  _lowerCAmelCase:						List[Any]=4		,  _lowerCAmelCase:						Union[str, Any]=37		,  _lowerCAmelCase:						Optional[Any]="gelu"		,  _lowerCAmelCase:						List[Any]=0.1		,  _lowerCAmelCase:						Any=0.1		,  _lowerCAmelCase:						List[str]=512		,  _lowerCAmelCase:						Optional[Any]=16		,  _lowerCAmelCase:						Dict=2		,  _lowerCAmelCase:						Optional[Any]=0.02		,  _lowerCAmelCase:						List[str]=3		,  _lowerCAmelCase:						int=4		,  _lowerCAmelCase:						List[str]=None		,  )						->    Any:
         '''simple docstring'''

         UpperCAmelCase_											=parent
         UpperCAmelCase_											=batch_size
         UpperCAmelCase_											=seq_length
         UpperCAmelCase_											=is_training
         UpperCAmelCase_											=use_input_mask
         UpperCAmelCase_											=use_token_type_ids
         UpperCAmelCase_											=use_labels
         UpperCAmelCase_											=vocab_size
         UpperCAmelCase_											=hidden_size
         UpperCAmelCase_											=num_hidden_layers
         UpperCAmelCase_											=num_attention_heads
         UpperCAmelCase_											=intermediate_size
         UpperCAmelCase_											=hidden_act
         UpperCAmelCase_											=hidden_dropout_prob
         UpperCAmelCase_											=attention_probs_dropout_prob
         UpperCAmelCase_											=max_position_embeddings
         UpperCAmelCase_											=type_vocab_size
         UpperCAmelCase_											=type_sequence_label_size
         UpperCAmelCase_											=initializer_range
         UpperCAmelCase_											=num_labels
         UpperCAmelCase_											=num_choices
         UpperCAmelCase_											=scope
         UpperCAmelCase_											=vocab_size - 1



      def 	lowerCAmelCase__    (	self:						Tuple       )						->    str:
         '''simple docstring'''

         UpperCAmelCase_											=ids_tensor([self.batch_size, self.seq_length]		,  self.vocab_size       )

         UpperCAmelCase_											=None
         if self.use_input_mask:
            UpperCAmelCase_											=random_attention_mask([self.batch_size, self.seq_length]       )

         UpperCAmelCase_											=None
         if self.use_labels:
            UpperCAmelCase_											=ids_tensor([self.batch_size, self.seq_length]		,  self.num_labels       )

         UpperCAmelCase_											=self.get_config()

         return config, input_ids, input_mask, token_labels



      def 	lowerCAmelCase__    (	self:						Union[str, Any]       )						->    Optional[Any]:
         '''simple docstring'''

         return GPTNeoXConfig(
             vocab_size=self.vocab_size		,  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		,  max_position_embeddings=self.max_position_embeddings		,  type_vocab_size=self.type_vocab_size		,  is_decoder=_lowerCAmelCase		,  initializer_range=self.initializer_range		,  pad_token_id=self.pad_token_id		,  )



      def 	lowerCAmelCase__    (	self:						Dict       )						->    List[str]:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_											=self.prepare_config_and_inputs()

         UpperCAmelCase_											=True

         return config, input_ids, input_mask, token_labels



      def 	lowerCAmelCase__    (	self:						Union[str, Any]		,  _lowerCAmelCase:						Optional[int]		,  _lowerCAmelCase:						Tuple		,  _lowerCAmelCase:						List[Any]       )						->    Optional[int]:
         '''simple docstring'''

         UpperCAmelCase_											=GPTNeoXModel(config=_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()
         UpperCAmelCase_											=model(_lowerCAmelCase		,  attention_mask=_lowerCAmelCase       )
         UpperCAmelCase_											=model(_lowerCAmelCase       )
         self.parent.assertEqual(result.last_hidden_state.shape		,  (self.batch_size, self.seq_length, self.hidden_size)       )



      def 	lowerCAmelCase__    (	self:						Any		,  _lowerCAmelCase:						List[str]		,  _lowerCAmelCase:						Any		,  _lowerCAmelCase:						int       )						->    Optional[int]:
         '''simple docstring'''

         UpperCAmelCase_											=True
         UpperCAmelCase_											=GPTNeoXModel(_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()
         UpperCAmelCase_											=model(_lowerCAmelCase		,  attention_mask=_lowerCAmelCase       )
         self.parent.assertEqual(result.last_hidden_state.shape		,  (self.batch_size, self.seq_length, self.hidden_size)       )



      def 	lowerCAmelCase__    (	self:						Any		,  _lowerCAmelCase:						int		,  _lowerCAmelCase:						str		,  _lowerCAmelCase:						List[str]		,  _lowerCAmelCase:						Tuple       )						->    Union[str, Any]:
         '''simple docstring'''

         UpperCAmelCase_											=GPTNeoXForCausalLM(config=_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()
         UpperCAmelCase_											=model(_lowerCAmelCase		,  attention_mask=_lowerCAmelCase		,  labels=_lowerCAmelCase       )
         self.parent.assertEqual(result.logits.shape		,  (self.batch_size, self.seq_length, self.vocab_size)       )



      def 	lowerCAmelCase__    (	self:						Tuple		,  _lowerCAmelCase:						Dict		,  _lowerCAmelCase:						Dict		,  _lowerCAmelCase:						Dict		,  _lowerCAmelCase:						Union[str, Any]       )						->    Optional[int]:
         '''simple docstring'''

         UpperCAmelCase_											=self.num_labels
         UpperCAmelCase_											=GPTNeoXForQuestionAnswering(_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()
         UpperCAmelCase_											=model(_lowerCAmelCase		,  attention_mask=_lowerCAmelCase       )
         self.parent.assertEqual(result.start_logits.shape		,  (self.batch_size, self.seq_length)       )
         self.parent.assertEqual(result.end_logits.shape		,  (self.batch_size, self.seq_length)       )



      def 	lowerCAmelCase__    (	self:						Optional[Any]		,  _lowerCAmelCase:						Optional[int]		,  _lowerCAmelCase:						int		,  _lowerCAmelCase:						str		,  _lowerCAmelCase:						Any       )						->    Union[str, Any]:
         '''simple docstring'''

         UpperCAmelCase_											=self.num_labels
         UpperCAmelCase_											=GPTNeoXForSequenceClassification(_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()
         UpperCAmelCase_											=ids_tensor([self.batch_size]		,  self.type_sequence_label_size       )
         UpperCAmelCase_											=model(_lowerCAmelCase		,  attention_mask=_lowerCAmelCase		,  labels=_lowerCAmelCase       )
         self.parent.assertEqual(result.logits.shape		,  (self.batch_size, self.num_labels)       )



      def 	lowerCAmelCase__    (	self:						Optional[Any]		,  _lowerCAmelCase:						Any		,  _lowerCAmelCase:						Optional[Any]		,  _lowerCAmelCase:						List[Any]		,  _lowerCAmelCase:						str       )						->    Dict:
         '''simple docstring'''

         UpperCAmelCase_											=self.num_labels
         UpperCAmelCase_											=GPTNeoXForTokenClassification(_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()
         UpperCAmelCase_											=model(_lowerCAmelCase		,  attention_mask=_lowerCAmelCase		,  labels=_lowerCAmelCase       )
         self.parent.assertEqual(result.logits.shape		,  (self.batch_size, self.seq_length, self.num_labels)       )



      def 	lowerCAmelCase__    (	self:						Optional[int]		,  _lowerCAmelCase:						Tuple		,  _lowerCAmelCase:						Union[str, Any]		,  _lowerCAmelCase:						Optional[int]       )						->    Optional[Any]:
         '''simple docstring'''

         UpperCAmelCase_											=True
         UpperCAmelCase_											=GPTNeoXForCausalLM(config=_lowerCAmelCase       )
         model.to(_lowerCAmelCase       )
         model.eval()

         # first forward pass
         UpperCAmelCase_											=model(_lowerCAmelCase		,  attention_mask=_lowerCAmelCase		,  use_cache=_lowerCAmelCase       )
         UpperCAmelCase_											=outputs.past_key_values

         # create hypothetical multiple next token and extent to next_input_ids
         UpperCAmelCase_											=ids_tensor((self.batch_size, 3)		,  config.vocab_size       )
         UpperCAmelCase_											=ids_tensor((self.batch_size, 3)		,  vocab_size=2       )

         # append to next input_ids and
         UpperCAmelCase_											=torch.cat([input_ids, next_tokens]		,  dim=-1       )
         UpperCAmelCase_											=torch.cat([input_mask, next_mask]		,  dim=-1       )

         UpperCAmelCase_											=model(_lowerCAmelCase		,  attention_mask=_lowerCAmelCase		,  output_hidden_states=_lowerCAmelCase       )
         UpperCAmelCase_											=output_from_no_past["hidden_states"][0]
         UpperCAmelCase_											=model(
             _lowerCAmelCase		,  attention_mask=_lowerCAmelCase		,  past_key_values=_lowerCAmelCase		,  output_hidden_states=_lowerCAmelCase		,  )["hidden_states"][0]

         # select random slice
         UpperCAmelCase_											=ids_tensor((1,)		,  output_from_past.shape[-1]       ).item()
         UpperCAmelCase_											=output_from_no_past[:, -3:, random_slice_idx].detach()
         UpperCAmelCase_											=output_from_past[:, :, random_slice_idx].detach()

         self.parent.assertTrue(output_from_past_slice.shape[1] == next_tokens.shape[1]       )

         # test that outputs are equal for slice
         self.parent.assertTrue(torch.allclose(_lowerCAmelCase		,  _lowerCAmelCase		,  atol=1e-3       )       )






      def 	lowerCAmelCase__    (	self:						Dict       )						->    Dict:
         '''simple docstring'''

         UpperCAmelCase_											=self.prepare_config_and_inputs()
         UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_											=config_and_inputs
         UpperCAmelCase_											={"input_ids": input_ids, "attention_mask": input_mask}
         return config, inputs_dict

@require_torch
class      A       (	__lowercase		,      __lowercase		,      __lowercase		,      unittest.TestCase						):
      _snake_case							     =(
          (
              GPTNeoXModel,
              GPTNeoXForCausalLM,
              GPTNeoXForQuestionAnswering,
              GPTNeoXForSequenceClassification,
              GPTNeoXForTokenClassification,
          )
          if is_torch_available()
          else ()
      )
      _snake_case							     =(GPTNeoXForCausalLM,) if is_torch_available() else ()
      _snake_case							     =(
          {
              '''feature-extraction''': GPTNeoXModel,
              '''question-answering''': GPTNeoXForQuestionAnswering,
              '''text-classification''': GPTNeoXForSequenceClassification,
              '''text-generation''': GPTNeoXForCausalLM,
              '''token-classification''': GPTNeoXForTokenClassification,
              '''zero-shot''': GPTNeoXForSequenceClassification,
          }
          if is_torch_available()
          else {}
      )
      _snake_case							     =False
      _snake_case							     =False
      _snake_case							     =False
      _snake_case							     =False



      def 	lowerCAmelCase__    (	self:						Optional[Any]       )						->    Tuple:
         '''simple docstring'''

         UpperCAmelCase_											=GPTNeoXModelTester(self       )
         UpperCAmelCase_											=ConfigTester(self		,  config_class=_lowerCAmelCase		,  hidden_size=64		,  num_attention_heads=8       )



      def 	lowerCAmelCase__    (	self:						Any       )						->    Dict:
         '''simple docstring'''

         self.config_tester.run_common_tests()



      def 	lowerCAmelCase__    (	self:						str       )						->    Tuple:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_model(_lowerCAmelCase		,  _lowerCAmelCase		,  _lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						Optional[int]       )						->    int:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs_for_decoder()
         self.model_tester.create_and_check_model_as_decoder(_lowerCAmelCase		,  _lowerCAmelCase		,  _lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						int       )						->    int:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs_for_decoder()

         UpperCAmelCase_											=None

         self.model_tester.create_and_check_model_as_decoder(_lowerCAmelCase		,  _lowerCAmelCase		,  _lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						Dict       )						->    Tuple:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_decoder_model_past_large_inputs(_lowerCAmelCase		,  _lowerCAmelCase		,  _lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						Tuple       )						->    List[Any]:
         '''simple docstring'''

         UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_causal_lm(*_lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						int       )						->    List[Any]:
         '''simple docstring'''

         UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_question_answering(*_lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						int       )						->    Dict:
         '''simple docstring'''

         UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_sequence_classification(*_lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						int       )						->    Dict:
         '''simple docstring'''

         UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs()
         self.model_tester.create_and_check_for_token_classification(*_lowerCAmelCase       )



      @unittest.skip(reason="Feed forward chunking is not implemented"       )
      def 	lowerCAmelCase__    (	self:						int       )						->    List[str]:
         '''simple docstring'''

         pass






      @parameterized.expand([("linear",), ("dynamic",)]       )
      def 	lowerCAmelCase__    (	self:						int		,  _lowerCAmelCase:						Any       )						->    Dict:
         '''simple docstring'''

         UpperCAmelCase_						,       UpperCAmelCase_											=self.model_tester.prepare_config_and_inputs_for_common()
         UpperCAmelCase_											=ids_tensor([1, 10]		,  config.vocab_size       )
         UpperCAmelCase_											=ids_tensor([1, int(config.max_position_embeddings * 1.5       )]		,  config.vocab_size       )

         set_seed(42       )  # Fixed seed at init time so the two models get the same random weights
         UpperCAmelCase_											=GPTNeoXModel(_lowerCAmelCase       )
         original_model.to(_lowerCAmelCase       )
         original_model.eval()
         UpperCAmelCase_											=original_model(_lowerCAmelCase       ).last_hidden_state
         UpperCAmelCase_											=original_model(_lowerCAmelCase       ).last_hidden_state

         set_seed(42       )  # Fixed seed at init time so the two models get the same random weights
         UpperCAmelCase_											={"type": scaling_type, "factor": 10.0}
         UpperCAmelCase_											=GPTNeoXModel(_lowerCAmelCase       )
         scaled_model.to(_lowerCAmelCase       )
         scaled_model.eval()
         UpperCAmelCase_											=scaled_model(_lowerCAmelCase       ).last_hidden_state
         UpperCAmelCase_											=scaled_model(_lowerCAmelCase       ).last_hidden_state

         # Dynamic scaling does not change the RoPE embeddings until it receives an input longer than the original
         # maximum sequence length, so the outputs for the short input should match.
         if scaling_type == "dynamic":
            self.assertTrue(torch.allclose(_lowerCAmelCase		,  _lowerCAmelCase		,  atol=1e-5       )       )
         else:
            self.assertFalse(torch.allclose(_lowerCAmelCase		,  _lowerCAmelCase		,  atol=1e-5       )       )

         # The output should be different for long inputs
         self.assertFalse(torch.allclose(_lowerCAmelCase		,  _lowerCAmelCase		,  atol=1e-5       )       )

@require_torch
class      A       (	unittest.TestCase						):



      @slow
      def 	lowerCAmelCase__    (	self:						Dict       )						->    str:
         '''simple docstring'''

         UpperCAmelCase_											=AutoTokenizer.from_pretrained("EleutherAI/pythia-410m-deduped"       )
         for checkpointing in [True, False]:
            UpperCAmelCase_											=GPTNeoXForCausalLM.from_pretrained("EleutherAI/pythia-410m-deduped"       )

            if checkpointing:
               model.gradient_checkpointing_enable()
            else:
               model.gradient_checkpointing_disable()
            model.to(_lowerCAmelCase       )

            UpperCAmelCase_											=tokenizer("My favorite food is"		,  return_tensors="pt"       ).to(_lowerCAmelCase       )
            # The hub repo. is updated on 2023-04-04, resulting in poor outputs.
            # See: https://github.com/huggingface/transformers/pull/24193
            UpperCAmelCase_											="My favorite food is a good old-fashioned, old-fashioned, old-fashioned.\n\nI'm not sure"

            UpperCAmelCase_											=model.generate(**_lowerCAmelCase		,  do_sample=_lowerCAmelCase		,  max_new_tokens=20       )
            UpperCAmelCase_											=tokenizer.batch_decode(_lowerCAmelCase       )[0]

            self.assertEqual(_lowerCAmelCase		,  _lowerCAmelCase       )











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

import yaml

class      A       (	yaml.SafeLoader						):



      def 	lowerCAmelCase__    (	self:						Optional[Any]		,  _lowerCAmelCase:						int       )						->    Optional[int]:
         '''simple docstring'''

         UpperCAmelCase_											=[self.constructed_objects[key_node] for key_node, _ in node.value]
         UpperCAmelCase_											=[tuple(_lowerCAmelCase       ) if isinstance(_lowerCAmelCase		,  _lowerCAmelCase       ) else key for key in keys]
         UpperCAmelCase_											=Counter(_lowerCAmelCase       )
         UpperCAmelCase_											=[key for key in counter if counter[key] > 1]
         if duplicate_keys:
            raise TypeError(F'Got duplicate yaml keys: {duplicate_keys}'       )






      def 	lowerCAmelCase__    (	self:						Dict		,  _lowerCAmelCase:						List[str]		,  _lowerCAmelCase:						Optional[Any]=False       )						->    int:
         '''simple docstring'''

         UpperCAmelCase_											=super().construct_mapping(_lowerCAmelCase		,  deep=_lowerCAmelCase       )
         self._check_no_duplicates_on_constructed_node(_lowerCAmelCase       )
         return mapping




def     a__ (					lowercase__  ):






   '''simple docstring'''






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

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

class      A       (	__lowercase						):
      # class attributes
      _snake_case							     ={'''train_eval_index'''}  # train-eval-index in the YAML metadata



      @classmethod
      def 	lowerCAmelCase__    (	cls:						Any		,  _lowerCAmelCase:						Path       )						->    "DatasetMetadata":
         '''simple docstring'''

         with open(_lowerCAmelCase		,  encoding="utf-8"       ) as readme_file:
            UpperCAmelCase_						,       UpperCAmelCase_											=_split_yaml_from_readme(readme_file.read()       )
         if yaml_string is not None:
            return cls.from_yaml_string(_lowerCAmelCase       )
         else:
            return cls()



      def 	lowerCAmelCase__    (	self:						Dict		,  _lowerCAmelCase:						Path       )						->    List[str]:
         '''simple docstring'''

         if path.exists():
            with open(_lowerCAmelCase		,  encoding="utf-8"       ) as readme_file:
               UpperCAmelCase_											=readme_file.read()
         else:
            UpperCAmelCase_											=None
         UpperCAmelCase_											=self._to_readme(_lowerCAmelCase       )
         with open(_lowerCAmelCase		,  "w"		,  encoding="utf-8"       ) as readme_file:
            readme_file.write(_lowerCAmelCase       )



      def 	lowerCAmelCase__    (	self:						str		,  _lowerCAmelCase:						Optional[str] = None       )						->    str:
         '''simple docstring'''

         if readme_content is not None:
            UpperCAmelCase_						,       UpperCAmelCase_											=_split_yaml_from_readme(_lowerCAmelCase       )
            UpperCAmelCase_											="---\n" + self.to_yaml_string() + "---\n" + content
         else:
            UpperCAmelCase_											="---\n" + self.to_yaml_string() + "---\n"
         return full_content



      @classmethod
      def 	lowerCAmelCase__    (	cls:						Optional[Any]		,  _lowerCAmelCase:						str       )						->    "DatasetMetadata":
         '''simple docstring'''

         UpperCAmelCase_											=yaml.load(_lowerCAmelCase		,  Loader=_NoDuplicateSafeLoader       ) or {}

         # Convert the YAML keys to DatasetMetadata fields
         UpperCAmelCase_											={
             (key.replace("-"		,  "_"       ) if key.replace("-"		,  "_"       ) in cls._FIELDS_WITH_DASHES else key): value
             for key, value in metadata_dict.items()
         }
         return cls(**_lowerCAmelCase       )






      def 	lowerCAmelCase__    (	self:						int       )						->    str:
         '''simple docstring'''

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

__lowercase  :   int						      ={
    """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

     __lowercase  :   List[Any]						      =ArgumentParser(usage="""Validate the yaml metadata block of a README.md file.""")
     ap.add_argument("""readme_filepath""")
     __lowercase  :   int						      =ap.parse_args()

     __lowercase  :   Optional[int]						      =Path(args.readme_filepath)
     __lowercase  :   Tuple						      =DatasetMetadata.from_readme(readme_filepath)
     print(dataset_metadata)
     dataset_metadata.to_readme(readme_filepath)




