





from ...processing_utils import ProcessorMixin



class    _a     (				_A							):






							"""simple docstring"""

							snake_case_							 =						"WhisperFeatureExtractor"
							snake_case_							 =						"WhisperTokenizer"

							def __init__(      self				:     Any							,	a				:     Dict							,	a				:     Optional[Any]    )	->List[Any]:
													super().__init__(UpperCamelCase__							,	UpperCamelCase__    )
													SCREAMING_SNAKE_CASE__     :				Union[str, Any]   =					self.feature_extractor
													SCREAMING_SNAKE_CASE__     :				Dict   =					False

							def      A_  (      self				:     Dict							,	a				:     Dict=None							,	a				:     Dict=None							,	a				:     Any=True    )	->Tuple:
													return self.tokenizer.get_decoder_prompt_ids(task=UpperCamelCase__							,	language=UpperCamelCase__							,	no_timestamps=UpperCamelCase__    )

							def __call__(      self				:     str							,	*a				:     Dict							,	**a				:     List[str]    )	->Dict:






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

													SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					kwargs.pop("audio"							,	UpperCamelCase__    )
													SCREAMING_SNAKE_CASE__     :				List[Any]   =					kwargs.pop("sampling_rate"							,	UpperCamelCase__    )
													SCREAMING_SNAKE_CASE__     :				Optional[Any]   =					kwargs.pop("text"							,	UpperCamelCase__    )
													if len(UpperCamelCase__    ) > 0:
																			SCREAMING_SNAKE_CASE__     :				List[Any]   =					args[0]
																			SCREAMING_SNAKE_CASE__     :				Tuple   =					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__     :				List[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__     :				Any   =					encodings["input_ids"]
																			return inputs

							def      A_  (      self				:     Optional[int]							,	*a				:     str							,	**a				:     Tuple    )	->List[Any]:
													return self.tokenizer.batch_decode(*UpperCamelCase__							,	**UpperCamelCase__    )

							def      A_  (      self				:     int							,	*a				:     Dict							,	**a				:     str    )	->Optional[int]:
													return self.tokenizer.decode(*UpperCamelCase__							,	**UpperCamelCase__    )






							def      A_  (      self				:     Dict							,	a				:     str							,	a				:     List[str]="np"    )	->List[str]:
													return self.tokenizer.get_prompt_ids(UpperCamelCase__							,	return_tensors=UpperCamelCase__    )






import sys

from .dependency_versions_table import deps
from .utils.versions import require_version, require_version_core


# define which module versions we always want to check at run time
# (usually the ones defined in `install_requires` in setup.py)
#
# order specific notes:
# - tqdm must be checked before tokenizers

__lowercase       :List[Any]       =  "python tqdm regex requests packaging filelock numpy tokenizers".split()
if sys.version_info < (3, 7):
				pkgs_to_check_at_runtime.append("dataclasses")
if sys.version_info < (3, 8):
				pkgs_to_check_at_runtime.append("importlib_metadata")

for pkg in pkgs_to_check_at_runtime:
				if pkg in deps:
								if pkg == "tokenizers":
												# must be loaded here, or else tqdm check may fail
												from .utils import is_tokenizers_available

												if not is_tokenizers_available():
																continue  # not required, check version only if installed

								require_version_core(deps[pkg])
				else:
								raise ValueError(f"can't find {pkg} in {deps.keys()}, check dependency_versions_table.py")







def       UpperCAmelCase							(     _lowerCamelCase      :  Optional[Any]			,   _lowerCamelCase      :  Optional[Any]=None     ):





						'''simple docstring'''


						require_version(deps[pkg]			,   _lowerCamelCase     )