





# 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 					__A    (    _a ):

			'''simple docstring'''







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

			lowerCAmelCase_							     =						["""audio"""]
			lowerCAmelCase_							     =						["""text"""]





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







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





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







				return self.model.generate(inputs=__lowerCAmelCase							)





			def 		__lowerCamelCase				(    self       ,  __lowerCAmelCase							):



				'''simple docstring'''







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







from __future__ import annotations

from math import ceil, floor, sqrt



def 				UpperCamelCase_(      lowerCamelCase_ = 200_0000 )    ->						int:
    _lowercase       :							list[int]      		=		[0]
    _lowercase       :							int

    for idx in range(1							, ceil(sqrt(target * 2 ) * 1.1 ) ):
        triangle_numbers.append(triangle_numbers[-1] + idx )

    # we want this to be as close as possible to target
    _lowercase       :							int      		=		0
    # the area corresponding to the grid that gives the product closest to target
    _lowercase       :							int      		=		0
    # an estimate of b, using the quadratic formula
    _lowercase       :							float
    # the largest integer less than b_estimate
    _lowercase       :							int
    # the largest integer less than b_estimate
    _lowercase       :							int
    # the triangle number corresponding to b_floor
    _lowercase       :							int
    # the triangle number corresponding to b_ceil
    _lowercase       :							int

    for idx_a, triangle_a in enumerate(triangle_numbers[1:]							, 1 ):
        _lowercase       :							Optional[int]      		=		(-1 + sqrt(1 + 8 * target / triangle_a )) / 2
        _lowercase       :							List[str]      		=		floor(lowerCamelCase_ )
        _lowercase       :							Dict      		=		ceil(lowerCamelCase_ )
        _lowercase       :							List[str]      		=		triangle_numbers[b_floor]
        _lowercase       :							List[str]      		=		triangle_numbers[b_ceil]

        if abs(target - triangle_b_first_guess * triangle_a ) < abs(
            target - best_product ):
            _lowercase       :							Union[str, Any]      		=		triangle_b_first_guess * triangle_a
            _lowercase       :							Union[str, Any]      		=		idx_a * b_floor

        if abs(target - triangle_b_second_guess * triangle_a ) < abs(
            target - best_product ):
            _lowercase       :							Any      		=		triangle_b_second_guess * triangle_a
            _lowercase       :							Optional[Any]      		=		idx_a * b_ceil

    return area


if __name__ == "__main__":
 print(F"{solution() = }")


