


'''simple docstring'''



# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from ..models.whisper import WhisperForConditionalGeneration, WhisperProcessor
from .base import PipelineTool






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

				__magic_name__    :				Optional[int]  		=	["audio"]
				__magic_name__    :				Optional[Any]  		=	["text"]




				def 					a__(		self      :			Optional[Any]				,   lowerCAmelCase      :			List[Any]				)->					Optional[int]:

										"""simple docstring"""




										return self.pre_processor(lowerCAmelCase				,   return_tensors='''pt'''				).input_features




				def 					a__(		self      :			Dict				,   lowerCAmelCase      :			Any				)->					str:

										"""simple docstring"""




										return self.model.generate(inputs=lowerCAmelCase				)





				def 					a__(		self      :			Dict				,   lowerCAmelCase      :			int				)->					int:

										"""simple docstring"""




										return self.pre_processor.batch_decode(lowerCAmelCase				,   skip_special_tokens=lowerCAmelCase				)[0]









'''simple docstring'''



# limitations under the License.

# NOTE: This file is deprecated and will be removed in a future version.
# It only exists so that temporarely `from diffusers.pipelines import DiffusionPipeline` works

from .pipelines import DiffusionPipeline, ImagePipelineOutput  # noqa: F401
from .utils import deprecate


deprecate(
    """pipelines_utils""",
    """0.22.0""",
    """Importing `DiffusionPipeline` or `ImagePipelineOutput` from diffusers.pipeline_utils is deprecated. Please import from diffusers.pipelines.pipeline_utils instead.""",
    standard_warn=False,
    stacklevel=3,
)





