





from ...processing_utils import ProcessorMixin



class        _SCREAMING_SNAKE_CASE						(     __SCREAMING_SNAKE_CASE   ):







 '''simple docstring'''
 lowercase_		=      ["image_processor", "feature_extractor"]
 lowercase_		=      "TvltImageProcessor"
 lowercase_		=      "TvltFeatureExtractor"

 def __init__(self    :       Union[str, Any]	,			UpperCAmelCase_    :       Tuple	,			UpperCAmelCase_    :       int)	->Tuple:



   '''simple docstring'''



   super().__init__(image_processor=UpperCAmelCase_	,			feature_extractor=UpperCAmelCase_)

   lowerCamelCase__:				Optional[Any]        =image_processor
   lowerCamelCase__:				Tuple        =feature_extractor

 def __call__(self    :       int	,			UpperCAmelCase_    :       int=None	,			UpperCAmelCase_    :       Any=None	,			UpperCAmelCase_    :       Any=None	,			UpperCAmelCase_    :       List[Any]=None	,			UpperCAmelCase_    :       List[Any]=False	,			UpperCAmelCase_    :       Dict=False	,			*UpperCAmelCase_    :       Union[str, Any]	,			**UpperCAmelCase_    :       List[Any]	,			)	->Tuple:



   '''simple docstring'''



   if images is None and audio is None:
     raise ValueError("You need to specify either an `images` or `audio` input to process.")

   lowerCamelCase__:				List[str]        =None
   if images is not None:
     lowerCamelCase__:				int        =self.image_processor(UpperCAmelCase_	,			mask_pixel=UpperCAmelCase_	,			*UpperCAmelCase_	,			**UpperCAmelCase_)
   if images_mixed is not None:
     lowerCamelCase__:				List[Any]        =self.image_processor(UpperCAmelCase_	,			is_mixed=UpperCAmelCase_	,			*UpperCAmelCase_	,			**UpperCAmelCase_)
   if audio is not None:
     lowerCamelCase__:				Dict        =self.feature_extractor(
         UpperCAmelCase_	,			*UpperCAmelCase_	,			sampling_rate=UpperCAmelCase_	,			mask_audio=UpperCAmelCase_	,			**UpperCAmelCase_)

   lowerCamelCase__:				Optional[int]        ={}
   if audio is not None:
     output_dict.update(UpperCAmelCase_)
   if images is not None:
     output_dict.update(UpperCAmelCase_)
   if images_mixed_dict is not None:
     output_dict.update(UpperCAmelCase_)
   return output_dict







 @property
 def 							SCREAMING_SNAKE_CASE_ (self    :       str)	->str:



   '''simple docstring'''



   lowerCamelCase__:				Dict        =self.image_processor.model_input_names
   lowerCamelCase__:				int        =self.feature_extractor.model_input_names
   return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names))








import inspect
import re

from transformers.utils import direct_transformers_import


# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_config_docstrings.py
__A     =    "src/transformers"


# This is to make sure the transformers module imported is the one in the repo.
__A     =    direct_transformers_import(PATH_TO_TRANSFORMERS)

__A     =    transformers.models.auto.configuration_auto.CONFIG_MAPPING

# Regex pattern used to find the checkpoint mentioned in the docstring of `config_class`.
# For example, `[bert-base-uncased](https://huggingface.co/bert-base-uncased)`
__A     =    re.compile(R"\[(.+?)\]\((https://huggingface\.co/.+?)\)")


__A     =    {
    "DecisionTransformerConfig",
    "EncoderDecoderConfig",
    "MusicgenConfig",
    "RagConfig",
    "SpeechEncoderDecoderConfig",
    "TimmBackboneConfig",
    "VisionEncoderDecoderConfig",
    "VisionTextDualEncoderConfig",
    "LlamaConfig",
}





def 					lowerCAmelCase_			(	__a		)					->		Optional[int]:







  """simple docstring"""





  lowerCamelCase__:				List[Any]        =None

  # source code of `config_class`
  lowerCamelCase__:				List[Any]        =inspect.getsource(__a		)
  lowerCamelCase__:				str        =_re_checkpoint.findall(__a		)

  # Each `checkpoint` is a tuple of a checkpoint name and a checkpoint link.
  # For example, `('bert-base-uncased', 'https://huggingface.co/bert-base-uncased')`
  for ckpt_name, ckpt_link in checkpoints:
    # allow the link to end with `/`
    if ckpt_link.endswith("/"		):
      lowerCamelCase__:				str        =ckpt_link[:-1]

    # verify the checkpoint name corresponds to the checkpoint link
    lowerCamelCase__:				Optional[int]        =F"""https://huggingface.co/{ckpt_name}"""
    if ckpt_link == ckpt_link_from_name:
      lowerCamelCase__:				List[Any]        =ckpt_name
      break

  return checkpoint





def 					lowerCAmelCase_			(	)					->		Tuple:







  """simple docstring"""





  lowerCamelCase__:				Union[str, Any]        =[]

  for config_class in list(CONFIG_MAPPING.values()		):
    # Skip deprecated models
    if "models.deprecated" in config_class.__module__:
      continue
    lowerCamelCase__:				List[Any]        =get_checkpoint_from_config_class(__a		)

    lowerCamelCase__:				Tuple        =config_class.__name__
    if checkpoint is None and name not in CONFIG_CLASSES_TO_IGNORE_FOR_DOCSTRING_CHECKPOINT_CHECK:
      configs_without_checkpoint.append(__a		)

  if len(__a		) > 0:
    lowerCamelCase__:				List[str]        ="\n".join(sorted(__a		)		)
    raise ValueError(F"""The following configurations don't contain any valid checkpoint:\n{message}"""		)


if __name__ == "__main__":
     check_config_docstrings_have_checkpoints()

