



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






class  SCREAMING_SNAKE_CASE      (				_lowerCamelCase       ):
							__lowerCamelCase						:						str     ='''openai/whisper-base'''
							__lowerCamelCase						:						Tuple     =(
							    '''This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the '''
							    '''transcribed text.'''
							)
							__lowerCamelCase						:						int     ='''transcriber'''
							__lowerCamelCase						:						int     =WhisperProcessor
							__lowerCamelCase						:						str     =WhisperForConditionalGeneration

							__lowerCamelCase						:						Union[str, Any]     =['''audio''']
							__lowerCamelCase						:						Optional[int]     =['''text''']





							def     UpperCamelCase_       ( self		:		Tuple   ,					__lowercase		:		Any						):

											'''simple docstring'''
											return self.pre_processor(_SCREAMING_SNAKE_CASE   ,					return_tensors="""pt"""						).input_features





							def     UpperCamelCase_       ( self		:		Dict   ,					__lowercase		:		List[Any]						):

											'''simple docstring'''
											return self.model.generate(inputs=_SCREAMING_SNAKE_CASE						)







							def     UpperCamelCase_       ( self		:		Dict   ,					__lowercase		:		str						):

											'''simple docstring'''
											return self.pre_processor.batch_decode(_SCREAMING_SNAKE_CASE   ,					skip_special_tokens=_SCREAMING_SNAKE_CASE						)[0]





"""simple docstring"""

from typing import TYPE_CHECKING

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


A_						:    str				=      {'configuration_unispeech': ['UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP', 'UniSpeechConfig']}

try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							A_						:    Optional[int]				=      [
							    'UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST',
							    'UniSpeechForCTC',
							    'UniSpeechForPreTraining',
							    'UniSpeechForSequenceClassification',
							    'UniSpeechModel',
							    'UniSpeechPreTrainedModel',
							]

if TYPE_CHECKING:
							from .configuration_unispeech import UNISPEECH_PRETRAINED_CONFIG_ARCHIVE_MAP, UniSpeechConfig

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_unispeech import (
														    UNISPEECH_PRETRAINED_MODEL_ARCHIVE_LIST,
														    UniSpeechForCTC,
														    UniSpeechForPreTraining,
														    UniSpeechForSequenceClassification,
														    UniSpeechModel,
														    UniSpeechPreTrainedModel,
														)

else:
							import sys

							A_						:    int				=      _LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)





