code: 
  
  import argparse
  import copy
  import json
  import multiprocessing
  import os
  import time
  
  from create_dummy_models import COMPOSITE_MODELS, create_tiny_models
  from huggingface_hub import ModelFilter, hf_api
  
  import transformers
  from transformers import AutoFeatureExtractor, AutoImageProcessor, AutoTokenizer
  from transformers.image_processing_utils import BaseImageProcessor
  
  
  def       __a       (   )      ->     List[Any]:
  
  
  
  
  
  
      '''simple docstring'''
      __UpperCAmelCase									=			set()
      # Each auto modeling files contains multiple mappings. Let's get them in a dynamic way.
      for module_name in ["modeling_auto", "modeling_tf_auto", "modeling_flax_auto"]:
          __UpperCAmelCase									=			getattr(transformers.models.auto       ,   SCREAMING_SNAKE_CASE       ,   SCREAMING_SNAKE_CASE      )
          if module is None:
              continue
          # all mappings in a single auto modeling file
          __UpperCAmelCase									=			[
              x
              for x in dir(SCREAMING_SNAKE_CASE      )
              if x.endswith('''_MAPPING_NAMES'''      )
              and (x.startswith('''MODEL_'''      ) or x.startswith('''TF_MODEL_'''      ) or x.startswith('''FLAX_MODEL_'''      ))
          ]
          for name in mapping_names:
              __UpperCAmelCase									=			getattr(SCREAMING_SNAKE_CASE       ,   SCREAMING_SNAKE_CASE      )
              if mapping is not None:
                  for v in mapping.values():
                      if isinstance(SCREAMING_SNAKE_CASE       ,   (list, tuple)      ):
                          model_names.update(SCREAMING_SNAKE_CASE      )
                      elif isinstance(SCREAMING_SNAKE_CASE       ,   SCREAMING_SNAKE_CASE      ):
                          model_names.add(SCREAMING_SNAKE_CASE      )
  
      return sorted(SCREAMING_SNAKE_CASE      )
  
  
  def       __a       (   )      ->     Any:
  
  
  
  
  
  
      '''simple docstring'''
      __UpperCAmelCase									=			set(get_all_model_names()      )
  
      with open('''tests/utils/tiny_model_summary.json'''      ) as fp:
          __UpperCAmelCase									=			json.load(SCREAMING_SNAKE_CASE      )
      __UpperCAmelCase									=			set()
      for model_base_name in tiny_model_info:
          tiny_models_names.update(tiny_model_info[model_base_name]['''model_classes''']      )
  
      # Remove a tiny model name if one of its framework implementation hasn't yet a tiny version on the Hub.
      __UpperCAmelCase									=			model_names.difference(SCREAMING_SNAKE_CASE      )
      for model_name in copy.copy(SCREAMING_SNAKE_CASE      ):
          if not model_name.startswith('''TF'''      ) and f'''TF{model_name}''' in not_on_hub:
              tiny_models_names.remove(SCREAMING_SNAKE_CASE      )
          elif model_name.startswith('''TF'''      ) and model_name[2:] in not_on_hub:
              tiny_models_names.remove(SCREAMING_SNAKE_CASE      )
  
      return sorted(SCREAMING_SNAKE_CASE      )
  
  
  def       __a       (   SCREAMING_SNAKE_CASE      )      ->     int:
  
  
  
  
  
  
      '''simple docstring'''
      __UpperCAmelCase									=			COMPOSITE_MODELS.values()
  
      # All tiny model base names on Hub
      __UpperCAmelCase									=			get_all_model_names()
      __UpperCAmelCase									=			hf_api.list_models(
          filter=ModelFilter(
              author='''hf-internal-testing'''       ,   )      )
      __UpperCAmelCase									=			set()
      for x in models:
          __UpperCAmelCase									=			x.modelId
          __UpperCAmelCase					,     __UpperCAmelCase									=			model.split('''/'''      )
          if not model.startswith('''tiny-random-'''      ):
              continue
          __UpperCAmelCase									=			model.replace('''tiny-random-'''       ,   ''''''      )
          if not model[0].isupper():
              continue
          if model not in model_names and model not in special_models:
              continue
          _models.add(SCREAMING_SNAKE_CASE      )
  
      __UpperCAmelCase									=			sorted(_models      )
      # All tiny model names on Hub
      __UpperCAmelCase									=			{}
      for model in models:
          __UpperCAmelCase									=			f'''hf-internal-testing/tiny-random-{model}'''
          __UpperCAmelCase									=			model.split('''-'''      )[0]
          try:
              __UpperCAmelCase									=			hf_api.repo_info(SCREAMING_SNAKE_CASE      )
              __UpperCAmelCase									=			{
                  '''tokenizer_classes''': set(),
                  '''processor_classes''': set(),
                  '''model_classes''': set(),
                  '''sha''': repo_info.sha,
              }
          except Exception:
              continue
          try:
              time.sleep(1      )
              __UpperCAmelCase									=			AutoTokenizer.from_pretrained(SCREAMING_SNAKE_CASE      )
              content["tokenizer_classes"].add(tokenizer_fast.__class__.__name__      )
          except Exception:
              pass
          try:
              time.sleep(1      )
              __UpperCAmelCase									=			AutoTokenizer.from_pretrained(SCREAMING_SNAKE_CASE       ,   use_fast=SCREAMING_SNAKE_CASE      )
              content["tokenizer_classes"].add(tokenizer_slow.__class__.__name__      )
          except Exception:
              pass
          try:
              time.sleep(1      )
              __UpperCAmelCase									=			AutoImageProcessor.from_pretrained(SCREAMING_SNAKE_CASE      )
              content["processor_classes"].add(img_p.__class__.__name__      )
          except Exception:
              pass
          try:
              time.sleep(1      )
              __UpperCAmelCase									=			AutoFeatureExtractor.from_pretrained(SCREAMING_SNAKE_CASE      )
              if not isinstance(SCREAMING_SNAKE_CASE       ,   SCREAMING_SNAKE_CASE      ):
                  content["processor_classes"].add(feat_p.__class__.__name__      )
          except Exception:
              pass
          try:
              time.sleep(1      )
              __UpperCAmelCase									=			getattr(SCREAMING_SNAKE_CASE       ,   SCREAMING_SNAKE_CASE      )
              __UpperCAmelCase									=			model_class.from_pretrained(SCREAMING_SNAKE_CASE      )
              content["model_classes"].add(m.__class__.__name__      )
          except Exception:
              pass
          try:
              time.sleep(1      )
              __UpperCAmelCase									=			getattr(SCREAMING_SNAKE_CASE       ,   f'''TF{model}'''      )
              __UpperCAmelCase									=			model_class.from_pretrained(SCREAMING_SNAKE_CASE      )
              content["model_classes"].add(m.__class__.__name__      )
          except Exception:
              pass
  
          __UpperCAmelCase									=			sorted(content['''tokenizer_classes''']      )
          __UpperCAmelCase									=			sorted(content['''processor_classes''']      )
          __UpperCAmelCase									=			sorted(content['''model_classes''']      )
  
          __UpperCAmelCase									=			content
          with open(os.path.join(SCREAMING_SNAKE_CASE       ,   '''hub_tiny_model_summary.json'''      )       ,   '''w'''      ) as fp:
              json.dump(SCREAMING_SNAKE_CASE       ,   SCREAMING_SNAKE_CASE       ,   ensure_ascii=SCREAMING_SNAKE_CASE       ,   indent=4      )
  
  
  if __name__ == "__main__":
         A_		:			Any										=   argparse.ArgumentParser()
         parser.add_argument('--num_workers', default=1, type=int, help='The number of workers to run.')
         A_		:			Optional[Any]										=   parser.parse_args()
  
         # This has to be `spawn` to avoid hanging forever!
         multiprocessing.set_start_method('spawn')
  
         A_		:			int										=   'tiny_models'
         A_		:			str										=   True
         A_		:			Tuple										=   None
         A_		:			Tuple										=   get_tiny_model_names_from_repo()
         A_		:			Optional[int]										=   True
         A_		:			Tuple										=   True
         A_		:			Optional[Any]										=   'hf-internal-testing'
  
         create_tiny_models(
             output_path,
             all,
             model_types,
             models_to_skip,
             no_check,
             upload,
             organization,
             token=os.environ.get('TOKEN', None),
             num_workers=args.num_workers,
         )
  
  
  
  
  
  
style_context: 
  
  import copy
  
  from ...configuration_utils import PretrainedConfig
  from ...utils import logging
  from ..auto.configuration_auto import AutoConfig
  
  
  A_		:			int										=   logging.get_logger(__name__)
  class 					A_   (      _a						):
  
  
      '''simple docstring'''
  
  
  
  
  
  
      a__     							=       "speech-encoder-decoder"
      a__     							=       True
  
  
      def __init__(self     ,      **lowercase__  )     ->      Optional[int]:
          super().__init__(**lowercase__  )
          if "encoder" not in kwargs or "decoder" not in kwargs:
              raise ValueError(
                  F'''A configuraton of type {self.model_type} cannot be instantiated because not both `encoder` and'''
                  F''' `decoder` sub-configurations are passed, but only {kwargs}'''  )
  
          __UpperCAmelCase									=			kwargs.pop('''encoder'''  )
          __UpperCAmelCase									=			encoder_config.pop('''model_type'''  )
          __UpperCAmelCase									=			kwargs.pop('''decoder'''  )
          __UpperCAmelCase									=			decoder_config.pop('''model_type'''  )
  
          __UpperCAmelCase									=			AutoConfig.for_model(lowercase__     ,      **lowercase__  )
          __UpperCAmelCase									=			AutoConfig.for_model(lowercase__     ,      **lowercase__  )
          __UpperCAmelCase									=			True
  
  
      @classmethod
      def      lowerCAmelCase_						(cls     ,      lowercase__     ,      lowercase__     ,      **lowercase__  )     ->      PretrainedConfig:
          logger.info('''Setting `config.is_decoder=True` and `config.add_cross_attention=True` for decoder_config'''  )
          __UpperCAmelCase									=			True
          __UpperCAmelCase									=			True
  
          return cls(encoder=encoder_config.to_dict()     ,      decoder=decoder_config.to_dict()     ,      **lowercase__  )
  
  
  
  
  
  
      def      lowerCAmelCase_						(self  )     ->      Optional[Any]:
          __UpperCAmelCase									=			copy.deepcopy(self.__dict__  )
          __UpperCAmelCase									=			self.encoder.to_dict()
          __UpperCAmelCase									=			self.decoder.to_dict()
          __UpperCAmelCase									=			self.__class__.model_type
          return output
  
  
  
  
  