


from ...processing_utils import ProcessorMixin
class       UpperCAmelCase_   (   _snake_case       ):

   '''simple docstring'''




   __A					: int							=						["image_processor", "feature_extractor"]
   __A					: Any							=						"TvltImageProcessor"
   __A					: List[str]							=						"TvltFeatureExtractor"






   def __init__(						self		,							__A		,							__A					):






     """simple docstring"""





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

     lowerCamelCase					:   Dict       =							image_processor
     lowerCamelCase					:   Optional[int]       =							feature_extractor






   def __call__(						self		,							__A=None		,							__A=None		,							__A=None		,							__A=None		,							__A=False		,							__A=False		,							*__A		,							**__A		,							):






     """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[Any]       =							None
     if images is not None:
       lowerCamelCase					:   str       =							self.image_processor(UpperCamelCase__		,							mask_pixel=UpperCamelCase__		,							*UpperCamelCase__		,							**UpperCamelCase__					)
     if images_mixed is not None:
       lowerCamelCase					:   List[str]       =							self.image_processor(UpperCamelCase__		,							is_mixed=UpperCamelCase__		,							*UpperCamelCase__		,							**UpperCamelCase__					)
     if audio is not None:
       lowerCamelCase					:   Optional[int]       =							self.feature_extractor(
           UpperCamelCase__		,							*UpperCamelCase__		,							sampling_rate=UpperCamelCase__		,							mask_audio=UpperCamelCase__		,							**UpperCamelCase__					)

     lowerCamelCase					:   str       =							{}
     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 _snake_case       (						self					):






     """simple docstring"""





     lowerCamelCase					:   Dict       =							self.image_processor.model_input_names
     lowerCamelCase					:   Optional[Any]       =							self.feature_extractor.model_input_names
     return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names					)					)






'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__lowerCamelCase									=     {
    '''configuration_whisper''': ['''WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''WhisperConfig''', '''WhisperOnnxConfig'''],
    '''feature_extraction_whisper''': ['''WhisperFeatureExtractor'''],
    '''processing_whisper''': ['''WhisperProcessor'''],
    '''tokenization_whisper''': ['''WhisperTokenizer'''],
}

try:
      if not is_tokenizers_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __lowerCamelCase									=     ['''WhisperTokenizerFast''']

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __lowerCamelCase									=     [
          '''WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''WhisperForConditionalGeneration''',
          '''WhisperModel''',
          '''WhisperPreTrainedModel''',
          '''WhisperForAudioClassification''',
      ]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __lowerCamelCase									=     [
          '''TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST''',
          '''TFWhisperForConditionalGeneration''',
          '''TFWhisperModel''',
          '''TFWhisperPreTrainedModel''',
      ]

try:
      if not is_flax_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      __lowerCamelCase									=     [
          '''FlaxWhisperForConditionalGeneration''',
          '''FlaxWhisperModel''',
          '''FlaxWhisperPreTrainedModel''',
          '''FlaxWhisperForAudioClassification''',
      ]


if TYPE_CHECKING:
      from .configuration_whisper import WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP, WhisperConfig, WhisperOnnxConfig
      from .feature_extraction_whisper import WhisperFeatureExtractor
      from .processing_whisper import WhisperProcessor
      from .tokenization_whisper import WhisperTokenizer

      try:
            if not is_tokenizers_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .tokenization_whisper_fast import WhisperTokenizerFast

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_whisper import (
                WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST,
                WhisperForAudioClassification,
                WhisperForConditionalGeneration,
                WhisperModel,
                WhisperPreTrainedModel,
            )

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_whisper import (
                TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFWhisperForConditionalGeneration,
                TFWhisperModel,
                TFWhisperPreTrainedModel,
            )

      try:
            if not is_flax_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_flax_whisper import (
                FlaxWhisperForAudioClassification,
                FlaxWhisperForConditionalGeneration,
                FlaxWhisperModel,
                FlaxWhisperPreTrainedModel,
            )

else:
      import sys

      __lowerCamelCase									=     _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
