


'''simple docstring'''



from ...processing_utils import ProcessorMixin





class 							__UpperCamelCase				(		lowerCAmelCase_					):
	A_				=    "WhisperFeatureExtractor"
	A_				=    "WhisperTokenizer"




	def __init__(   self						,				__a						,				__a							):

						'''simple docstring'''





						super().__init__(__a						,				__a							)
						__a			:       List[str]					    =  self.feature_extractor
						__a			:       Optional[int]					    =  False




	def       __UpperCAmelCase							(   self						,				__a=None						,				__a=None						,				__a=True							):

						'''simple docstring'''





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




	def __call__(   self						,				*__a						,				**__a							):

						'''simple docstring'''





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

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

						if text is None:
											return inputs

						elif audio is None:
											return encodings
						else:
											__a			:       Tuple					    =  encodings['input_ids']
											return inputs




	def       __UpperCAmelCase							(   self						,				*__a						,				**__a							):

						'''simple docstring'''





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




	def       __UpperCAmelCase							(   self						,				*__a						,				**__a							):

						'''simple docstring'''





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





	def       __UpperCAmelCase							(   self						,				__a						,				__a="np"							):

						'''simple docstring'''





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







'''simple docstring'''



from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


__lowercase	:						Union[str, Any]       =	{
    'configuration_blenderbot': [
        'BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP',
        'BlenderbotConfig',
        'BlenderbotOnnxConfig',
    ],
    'tokenization_blenderbot': ['BlenderbotTokenizer'],
}

try:
	if not is_tokenizers_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowercase	:						List[Any]       =	['BlenderbotTokenizerFast']

try:
	if not is_torch_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowercase	:						List[Any]       =	[
	    'BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST',
	    'BlenderbotForCausalLM',
	    'BlenderbotForConditionalGeneration',
	    'BlenderbotModel',
	    'BlenderbotPreTrainedModel',
	]


try:
	if not is_tf_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowercase	:						Union[str, Any]       =	[
	    'TFBlenderbotForConditionalGeneration',
	    'TFBlenderbotModel',
	    'TFBlenderbotPreTrainedModel',
	]


try:
	if not is_flax_available():
		raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
	pass
else:
	__lowercase	:						Dict       =	[
	    'FlaxBlenderbotForConditionalGeneration',
	    'FlaxBlenderbotModel',
	    'FlaxBlenderbotPreTrainedModel',
	]


if TYPE_CHECKING:
	from .configuration_blenderbot import (
	    BLENDERBOT_PRETRAINED_CONFIG_ARCHIVE_MAP,
	    BlenderbotConfig,
	    BlenderbotOnnxConfig,
	)
	from .tokenization_blenderbot import BlenderbotTokenizer

	try:
		if not is_tokenizers_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .tokenization_blenderbot_fast import BlenderbotTokenizerFast

	try:
		if not is_torch_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_blenderbot import (
		    BLENDERBOT_PRETRAINED_MODEL_ARCHIVE_LIST,
		    BlenderbotForCausalLM,
		    BlenderbotForConditionalGeneration,
		    BlenderbotModel,
		    BlenderbotPreTrainedModel,
		)

	try:
		if not is_tf_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_tf_blenderbot import (
		    TFBlenderbotForConditionalGeneration,
		    TFBlenderbotModel,
		    TFBlenderbotPreTrainedModel,
		)

	try:
		if not is_flax_available():
			raise OptionalDependencyNotAvailable()
	except OptionalDependencyNotAvailable:
		pass
	else:
		from .modeling_flax_blenderbot import (
		    FlaxBlenderbotForConditionalGeneration,
		    FlaxBlenderbotModel,
		    FlaxBlenderbotPreTrainedModel,
		)

else:
	import sys

	__lowercase	:						str       =	_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



