
'''simple docstring'''




from ...processing_utils import ProcessorMixin





class  A				(							__snake_case						):
     __magic_name__						=		'''WhisperFeatureExtractor'''
     __magic_name__						=		'''WhisperTokenizer'''





     def __init__(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE	) ->				Optional[int]:






         """simple docstring"""






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





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE=None						,			SCREAMING_SNAKE_CASE=None						,			SCREAMING_SNAKE_CASE=True	) ->				Any:






         """simple docstring"""






         return self.tokenizer.get_decoder_prompt_ids(task=SCREAMING_SNAKE_CASE						,			language=SCREAMING_SNAKE_CASE						,			no_timestamps=SCREAMING_SNAKE_CASE	)





     def __call__(							self						,			*SCREAMING_SNAKE_CASE						,			**SCREAMING_SNAKE_CASE	) ->				Optional[Any]:






         """simple docstring"""






         if self._in_target_context_manager:
             return self.current_processor(*SCREAMING_SNAKE_CASE						,			**SCREAMING_SNAKE_CASE	)

         A       :   Optional[Any]					=						kwargs.pop('''audio'''						,			SCREAMING_SNAKE_CASE	)
         A       :   Any					=						kwargs.pop('''sampling_rate'''						,			SCREAMING_SNAKE_CASE	)
         A       :   Optional[int]					=						kwargs.pop('''text'''						,			SCREAMING_SNAKE_CASE	)
         if len(SCREAMING_SNAKE_CASE	) > 0:
             A       :   Optional[int]					=						args[0]
             A       :   Optional[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:
             A       :   int					=						self.feature_extractor(SCREAMING_SNAKE_CASE						,			*SCREAMING_SNAKE_CASE						,			sampling_rate=SCREAMING_SNAKE_CASE						,			**SCREAMING_SNAKE_CASE	)
         if text is not None:
             A       :   Tuple					=						self.tokenizer(SCREAMING_SNAKE_CASE						,			**SCREAMING_SNAKE_CASE	)

         if text is None:
             return inputs

         elif audio is None:
             return encodings
         else:
             A       :   List[str]					=						encodings['''input_ids''']
             return inputs





     def 				__lowerCAmelCase							(							self						,			*SCREAMING_SNAKE_CASE						,			**SCREAMING_SNAKE_CASE	) ->				Optional[int]:






         """simple docstring"""






         return self.tokenizer.batch_decode(*SCREAMING_SNAKE_CASE						,			**SCREAMING_SNAKE_CASE	)





     def 				__lowerCAmelCase							(							self						,			*SCREAMING_SNAKE_CASE						,			**SCREAMING_SNAKE_CASE	) ->				str:






         """simple docstring"""






         return self.tokenizer.decode(*SCREAMING_SNAKE_CASE						,			**SCREAMING_SNAKE_CASE	)





     def 				__lowerCAmelCase							(							self						,			SCREAMING_SNAKE_CASE						,			SCREAMING_SNAKE_CASE="np"	) ->				Dict:






         """simple docstring"""






         return self.tokenizer.get_prompt_ids(SCREAMING_SNAKE_CASE						,			return_tensors=SCREAMING_SNAKE_CASE	)






'''simple docstring'''




from dataclasses import dataclass
from typing import List, Optional, Union

import numpy as np
import PIL

from ...utils import BaseOutput, OptionalDependencyNotAvailable, is_torch_available, is_transformers_available
from .timesteps import (
    fastaa_timesteps,
    smartaa_timesteps,
    smartaa_timesteps,
    smartaaa_timesteps,
    smartaaa_timesteps,
    superaa_timesteps,
    superaa_timesteps,
    superaaa_timesteps,
)





@dataclass
class  A				(							__snake_case						):
     __magic_name__						=		42
     __magic_name__						=		42
     __magic_name__						=		42


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 .pipeline_if import IFPipeline
      from .pipeline_if_imgaimg import IFImgaImgPipeline
      from .pipeline_if_imgaimg_superresolution import IFImgaImgSuperResolutionPipeline
      from .pipeline_if_inpainting import IFInpaintingPipeline
      from .pipeline_if_inpainting_superresolution import IFInpaintingSuperResolutionPipeline
      from .pipeline_if_superresolution import IFSuperResolutionPipeline
      from .safety_checker import IFSafetyChecker
      from .watermark import IFWatermarker




