




"""simple docstring"""





from ...processing_utils import ProcessorMixin



class      a__				(	__magic_name__   ):
			lowercase_    =	"WhisperFeatureExtractor"
			lowercase_    =	"WhisperTokenizer"


			def __init__(      self      :    Any      ,  UpperCamelCase_      :    List[Any]      ,  UpperCamelCase_      :    List[str]):


						"""simple docstring"""




						super().__init__(UpperCamelCase_      ,  UpperCamelCase_)
						__UpperCAmelCase	: Dict		=					self.feature_extractor
						__UpperCAmelCase	: str		=					False


			def       a_     (      self      :    Union[str, Any]      ,  UpperCamelCase_      :    Any=None      ,  UpperCamelCase_      :    Optional[Any]=None      ,  UpperCamelCase_      :    Optional[Any]=True):


						"""simple docstring"""




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


			def __call__(      self      :    Dict      ,  *UpperCamelCase_      :    Dict      ,  **UpperCamelCase_      :    Optional[int]):


						"""simple docstring"""




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

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

						if text is None:
									return inputs

						elif audio is None:
									return encodings
						else:
									__UpperCAmelCase	: str		=					encodings["input_ids"]
									return inputs


			def       a_     (      self      :    List[str]      ,  *UpperCamelCase_      :    Optional[int]      ,  **UpperCamelCase_      :    int):


						"""simple docstring"""




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


			def       a_     (      self      :    List[Any]      ,  *UpperCamelCase_      :    Optional[Any]      ,  **UpperCamelCase_      :    Optional[Any]):


						"""simple docstring"""




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


			def       a_     (      self      :    int      ,  UpperCamelCase_      :    str      ,  UpperCamelCase_      :    Union[str, Any]="np"):


						"""simple docstring"""




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












"""simple docstring"""





from ...processing_utils import ProcessorMixin



class      a__				(	__magic_name__   ):
			lowercase_    =	["image_processor", "feature_extractor"]
			lowercase_    =	"TvltImageProcessor"
			lowercase_    =	"TvltFeatureExtractor"


			def __init__(      self      :    Tuple      ,  UpperCamelCase_      :    Optional[int]      ,  UpperCamelCase_      :    Dict):


						"""simple docstring"""




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

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


			def __call__(      self      :    Tuple      ,  UpperCamelCase_      :    str=None      ,  UpperCamelCase_      :    Optional[int]=None      ,  UpperCamelCase_      :    Optional[int]=None      ,  UpperCamelCase_      :    str=None      ,  UpperCamelCase_      :    List[str]=False      ,  UpperCamelCase_      :    Optional[int]=False      ,  *UpperCamelCase_      :    List[str]      ,  **UpperCamelCase_      :    str      ,  ):


						"""simple docstring"""




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

						__UpperCAmelCase	: Optional[Any]		=					None
						if images is not None:
									__UpperCAmelCase	: int		=					self.image_processor(UpperCamelCase_      ,  mask_pixel=UpperCamelCase_      ,  *UpperCamelCase_      ,  **UpperCamelCase_)
						if images_mixed is not None:
									__UpperCAmelCase	: int		=					self.image_processor(UpperCamelCase_      ,  is_mixed=UpperCamelCase_      ,  *UpperCamelCase_      ,  **UpperCamelCase_)
						if audio is not None:
									__UpperCAmelCase	: List[Any]		=					self.feature_extractor(
									    UpperCamelCase_      ,  *UpperCamelCase_      ,  sampling_rate=UpperCamelCase_      ,  mask_audio=UpperCamelCase_      ,  **UpperCamelCase_)

						__UpperCAmelCase	: List[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       a_     (      self      :    str):


						"""simple docstring"""




						__UpperCAmelCase	: List[Any]		=					self.image_processor.model_input_names
						__UpperCAmelCase	: List[Any]		=					self.feature_extractor.model_input_names
						return list(dict.fromkeys(image_processor_input_names + feature_extractor_input_names))


