


import warnings
from contextlib import contextmanager

from ...processing_utils import ProcessorMixin
class 	lowerCamelCase_       (				UpperCamelCase__				):



					'''simple docstring'''







					__UpperCAmelCase            =				"Speech2TextFeatureExtractor"
					__UpperCAmelCase            =				"Speech2TextTokenizer"






					def __init__(				self ,       snake_case_ ,       snake_case_						)   ->			Tuple:







								'''simple docstring'''

								super().__init__(__A ,       __A						)
								__lowercase 					=   self.feature_extractor
								__lowercase 					=   False






					def __call__(				self ,       *snake_case_ ,       **snake_case_						)   ->			int:







								'''simple docstring'''

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

								if "raw_speech" in kwargs:
											warnings.warn('''Using `raw_speech` as a keyword argument is deprecated. Use `audio` instead.'''						)
											__lowercase 					=   kwargs.pop('''raw_speech'''						)
								else:
											__lowercase 					=   kwargs.pop('''audio''' ,       __A						)
								__lowercase 					=   kwargs.pop('''sampling_rate''' ,       __A						)
								__lowercase 					=   kwargs.pop('''text''' ,       __A						)
								if len(__A						) > 0:
											__lowercase 					=   args[0]
											__lowercase 					=   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:
											__lowercase 					=   self.feature_extractor(__A ,       *__A ,       sampling_rate=__A ,       **__A						)
								if text is not None:
											__lowercase 					=   self.tokenizer(__A ,       **__A						)

								if text is None:
											return inputs
								elif audio is None:
											return encodings
								else:
											__lowercase 					=   encodings['''input_ids''']
											return inputs






					def A      (				self ,       *snake_case_ ,       **snake_case_						)   ->			List[Any]:







								'''simple docstring'''

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






					def A      (				self ,       *snake_case_ ,       **snake_case_						)   ->			Dict:







								'''simple docstring'''

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






					@contextmanager
					def A      (				self						)   ->			Optional[int]:







								'''simple docstring'''

								warnings.warn(
								    '''`as_target_processor` is deprecated and will be removed in v5 of Transformers. You can process your '''
								    '''labels by using the argument `text` of the regular `__call__` method (either in the same call as '''
								    '''your audio inputs, or in a separate call.'''						)
								__lowercase 					=   True
								__lowercase 					=   self.tokenizer
								yield
								__lowercase 					=   self.feature_extractor
								__lowercase 					=   False






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 	lowerCamelCase_       (				lowerCAmelCase__				):



					'''simple docstring'''







					__UpperCAmelCase            =				42
					__UpperCAmelCase            =				42
					__UpperCAmelCase            =				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


