
"""simple docstring"""





from collections import OrderedDict
from typing import Mapping

from packaging import version

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


__magic_name__       =			logging.get_logger(__name__)

__magic_name__       =			{
    "facebook/levit-128S": "https://huggingface.co/facebook/levit-128S/resolve/main/config.json",
    # See all LeViT models at https://huggingface.co/models?filter=levit
}
class 						SCREAMING_SNAKE_CASE_ (						__a ):




		"""simple docstring"""





		__lowercase							:  Optional[int]						   =		'''levit'''




		def __init__(     self							,  lowerCAmelCase__=2_2_4							,  lowerCAmelCase__=3							,  lowerCAmelCase__=3							,  lowerCAmelCase__=2							,  lowerCAmelCase__=1							,  lowerCAmelCase__=1_6							,  lowerCAmelCase__=[1_2_8, 2_5_6, 3_8_4]							,  lowerCAmelCase__=[4, 8, 1_2]							,  lowerCAmelCase__=[4, 4, 4]							,  lowerCAmelCase__=[1_6, 1_6, 1_6]							,  lowerCAmelCase__=0							,  lowerCAmelCase__=[2, 2, 2]							,  lowerCAmelCase__=[2, 2, 2]							,  lowerCAmelCase__=0.02							,  **lowerCAmelCase__							,  ):
				super().__init__(**lowerCAmelCase__)
				__SCREAMING_SNAKE_CASE            = image_size
				__SCREAMING_SNAKE_CASE            = num_channels
				__SCREAMING_SNAKE_CASE            = kernel_size
				__SCREAMING_SNAKE_CASE            = stride
				__SCREAMING_SNAKE_CASE            = padding
				__SCREAMING_SNAKE_CASE            = hidden_sizes
				__SCREAMING_SNAKE_CASE            = num_attention_heads
				__SCREAMING_SNAKE_CASE            = depths
				__SCREAMING_SNAKE_CASE            = key_dim
				__SCREAMING_SNAKE_CASE            = drop_path_rate
				__SCREAMING_SNAKE_CASE            = patch_size
				__SCREAMING_SNAKE_CASE            = attention_ratio
				__SCREAMING_SNAKE_CASE            = mlp_ratio
				__SCREAMING_SNAKE_CASE            = initializer_range
				__SCREAMING_SNAKE_CASE            = [
				    ["""Subsample""", key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
				    ["""Subsample""", key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
				]



class 						SCREAMING_SNAKE_CASE_ (						__a ):




		"""simple docstring"""





		__lowercase							:  int						   =		version.parse('''1.11''' )




		@property
		def 	snake_case_     (     self):
				return OrderedDict(
				    [
				        ("""pixel_values""", {0: """batch""", 1: """num_channels""", 2: """height""", 3: """width"""}),
				    ])




		@property
		def 	snake_case_     (     self):
				return 1E-4








# 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_					(					UpperCamelCase    ):

   '''simple docstring'''




   __A :      Dict     		=		"openai/whisper-base"
   __A :      str     		=		(
       "This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the "
       "transcribed text."
   )
   __A :      Any     		=		"transcriber"
   __A :      Any     		=		WhisperProcessor
   __A :      int     		=		WhisperForConditionalGeneration

   __A :      Any     		=		["audio"]
   __A :      List[str]     		=		["text"]






   def _snake_case    (		self						,				__A ):






     """simple docstring"""





     return self.pre_processor(__A						,				return_tensors="pt" ).input_features






   def _snake_case    (		self						,				__A ):






     """simple docstring"""





     return self.model.generate(inputs=__A )






   def _snake_case    (		self						,				__A ):






     """simple docstring"""





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



