






from ...processing_utils import ProcessorMixin


class  SCREAMING_SNAKE_CASE			(			lowerCAmelCase					):
     '''simple docstring'''


     UpperCamelCase_							:		str			=	'''WhisperFeatureExtractor'''
     UpperCamelCase_							:		Optional[int]			=	'''WhisperTokenizer'''


     def __init__(				self       :	Optional[Any]					, UpperCAmelCase_       :	Union[str, Any]					, UpperCAmelCase_       :	List[Any]      ):
       super().__init__(UpperCAmelCase_					, UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      Any							=    self.feature_extractor
       SCREAMING_SNAKE_CASE       :      str							=    False


     def 				_A       (				self       :	int					, UpperCAmelCase_       :	Union[str, Any]=None					, UpperCAmelCase_       :	Optional[int]=None					, UpperCAmelCase_       :	int=True      ):
       return self.tokenizer.get_decoder_prompt_ids(task=UpperCAmelCase_					, language=UpperCAmelCase_					, no_timestamps=UpperCAmelCase_      )


     def __call__(				self       :	List[Any]					, *UpperCAmelCase_       :	List[Any]					, **UpperCAmelCase_       :	Optional[int]      ):
       # For backward compatibility
       if self._in_target_context_manager:
         return self.current_processor(*UpperCAmelCase_					, **UpperCAmelCase_      )

       SCREAMING_SNAKE_CASE       :      Union[str, Any]							=    kwargs.pop("audio"					, UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      str							=    kwargs.pop("sampling_rate"					, UpperCAmelCase_      )
       SCREAMING_SNAKE_CASE       :      Optional[int]							=    kwargs.pop("text"					, UpperCAmelCase_      )
       if len(UpperCAmelCase_      ) > 0:
         SCREAMING_SNAKE_CASE       :      Union[str, Any]							=    args[0]
         SCREAMING_SNAKE_CASE       :      int							=    args[1:]

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

       if audio is not None:
         SCREAMING_SNAKE_CASE       :      Optional[Any]							=    self.feature_extractor(UpperCAmelCase_					, *UpperCAmelCase_					, sampling_rate=UpperCAmelCase_					, **UpperCAmelCase_      )
       if text is not None:
         SCREAMING_SNAKE_CASE       :      Optional[Any]							=    self.tokenizer(UpperCAmelCase_					, **UpperCAmelCase_      )

       if text is None:
         return inputs

       elif audio is None:
         return encodings
       else:
         SCREAMING_SNAKE_CASE       :      Tuple							=    encodings["input_ids"]
         return inputs


     def 				_A       (				self       :	str					, *UpperCAmelCase_       :	Union[str, Any]					, **UpperCAmelCase_       :	Dict      ):
       return self.tokenizer.batch_decode(*UpperCAmelCase_					, **UpperCAmelCase_      )


     def 				_A       (				self       :	Any					, *UpperCAmelCase_       :	int					, **UpperCAmelCase_       :	str      ):
       return self.tokenizer.decode(*UpperCAmelCase_					, **UpperCAmelCase_      )






     def 				_A       (				self       :	str					, UpperCAmelCase_       :	str					, UpperCAmelCase_       :	Tuple="np"      ):
       return self.tokenizer.get_prompt_ids(UpperCAmelCase_					, return_tensors=UpperCAmelCase_      )














from ...utils import (
    OptionalDependencyNotAvailable,
    is_flax_available,
    is_torch_available,
    is_transformers_available,
)


try:
   if not (is_transformers_available() and is_torch_available()):
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
   from .multicontrolnet import MultiControlNetModel
   from .pipeline_controlnet import StableDiffusionControlNetPipeline
   from .pipeline_controlnet_imgaimg import StableDiffusionControlNetImgaImgPipeline
   from .pipeline_controlnet_inpaint import StableDiffusionControlNetInpaintPipeline


if is_transformers_available() and is_flax_available():
   from .pipeline_flax_controlnet import FlaxStableDiffusionControlNetPipeline






