
from ..models.whisper import WhisperForConditionalGeneration, WhisperProcessor
from .base import PipelineTool





class 	snake_case__ (							_lowerCAmelCase				):
	lowercase__						:					str											=   """openai/whisper-base"""
	lowercase__						:					Optional[Any]											=   (
	    """This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the """
	    """transcribed text."""
	)
	lowercase__						:					List[Any]											=   """transcriber"""
	lowercase__						:					Any											=   WhisperProcessor
	lowercase__						:					List[str]											=   WhisperForConditionalGeneration

	lowercase__						:					List[str]											=   ["""audio"""]
	lowercase__						:					List[Any]											=   ["""text"""]
	def       __magic_name__    (    self      ,       lowerCAmelCase__			)							->				Optional[Any]:
							return self.pre_processor(_A      ,       return_tensors="""pt"""			).input_features
	def       __magic_name__    (    self      ,       lowerCAmelCase__			)							->				Union[str, Any]:
							return self.model.generate(inputs=_A			)







	def       __magic_name__    (    self      ,       lowerCAmelCase__			)							->				Dict:
							return self.pre_processor.batch_decode(_A      ,       skip_special_tokens=_A			)[0]








from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


__magic_name__:					Tuple							=     {
    "configuration_tapas": ["TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP", "TapasConfig"],
    "tokenization_tapas": ["TapasTokenizer"],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__magic_name__:					Dict							=     [
		    "TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "TapasForMaskedLM",
		    "TapasForQuestionAnswering",
		    "TapasForSequenceClassification",
		    "TapasModel",
		    "TapasPreTrainedModel",
		    "load_tf_weights_in_tapas",
		]
try:
		if not is_tf_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		__magic_name__:					int							=     [
		    "TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST",
		    "TFTapasForMaskedLM",
		    "TFTapasForQuestionAnswering",
		    "TFTapasForSequenceClassification",
		    "TFTapasModel",
		    "TFTapasPreTrainedModel",
		]


if TYPE_CHECKING:
		from .configuration_tapas import TAPAS_PRETRAINED_CONFIG_ARCHIVE_MAP, TapasConfig
		from .tokenization_tapas import TapasTokenizer

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tapas import (
				    TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TapasForMaskedLM,
				    TapasForQuestionAnswering,
				    TapasForSequenceClassification,
				    TapasModel,
				    TapasPreTrainedModel,
				    load_tf_weights_in_tapas,
				)

		try:
				if not is_tf_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_tf_tapas import (
				    TF_TAPAS_PRETRAINED_MODEL_ARCHIVE_LIST,
				    TFTapasForMaskedLM,
				    TFTapasForQuestionAnswering,
				    TFTapasForSequenceClassification,
				    TFTapasModel,
				    TFTapasPreTrainedModel,
				)


else:
		import sys

		__magic_name__:					Tuple							=     _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
