



'''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 	lowerCAmelCase_(    SCREAMING_SNAKE_CASE_					):
  '''simple docstring'''




  __lowercase							:				Union[str, Any]           =				'''openai/whisper-base'''
  __lowercase							:				Optional[int]           =				(
      '''This is a tool that transcribes an audio into text. It takes an input named `audio` and returns the '''
      '''transcribed text.'''
  )
  __lowercase							:				Tuple           =				'''transcriber'''
  __lowercase							:				Tuple           =				WhisperProcessor
  __lowercase							:				Union[str, Any]           =				WhisperForConditionalGeneration

  __lowercase							:				int           =				['''audio''']
  __lowercase							:				str           =				['''text''']




  def 							UpperCAmelCase_     (   self  ,__UpperCAmelCase				)   ->		int:
      return self.pre_processor(__UpperCAmelCase  ,return_tensors="""pt"""				).input_features




  def 							UpperCAmelCase_     (   self  ,__UpperCAmelCase				)   ->		List[Any]:
      return self.model.generate(inputs=__UpperCAmelCase				)






  def 							UpperCAmelCase_     (   self  ,__UpperCAmelCase				)   ->		List[str]:
      return self.pre_processor.batch_decode(__UpperCAmelCase  ,skip_special_tokens=__UpperCAmelCase				)[0]







'''simple docstring'''





def        _SCREAMING_SNAKE_CASE  (	UpperCamelCase							,   UpperCamelCase							,   UpperCamelCase      ):



    """simple docstring"""





    def count_of_possible_combinations(UpperCamelCase      ) -> int:
        if target < 0:
            return 0
        if target == 0:
            return 1
        return sum(count_of_possible_combinations(target - item      ) for item in array      )

    return count_of_possible_combinations(UpperCamelCase      )
def        _SCREAMING_SNAKE_CASE  (	UpperCamelCase							,   UpperCamelCase							,   UpperCamelCase      ):



    """simple docstring"""





    def count_of_possible_combinations_with_dp_array(
        UpperCamelCase							,   UpperCamelCase      ) -> int:
        if target < 0:
            return 0
        if target == 0:
            return 1
        if dp_array[target] != -1:
            return dp_array[target]
        lowerCAmelCase__			:  Any											= sum(
            count_of_possible_combinations_with_dp_array(target - item							,   UpperCamelCase      )
            for item in array      )
        lowerCAmelCase__			:  Tuple											= answer
        return answer

    lowerCAmelCase__			:  Optional[int]											= [-1] * (target + 1)
    return count_of_possible_combinations_with_dp_array(UpperCamelCase							,   UpperCamelCase      )
def        _SCREAMING_SNAKE_CASE  (	UpperCamelCase							,   UpperCamelCase							,   UpperCamelCase      ):



    """simple docstring"""





    lowerCAmelCase__			:  str											= [0] * (target + 1)
    lowerCAmelCase__			:  List[Any]											= 1

    for i in range(1							,   target + 1      ):
        for j in range(UpperCamelCase      ):
            if i - array[j] >= 0:
                dp_array[i] += dp_array[i - array[j]]

    return dp_array[target]


if __name__ == "__main__":
 import doctest

 doctest.testmod()
 _lowerCAmelCase										=     3
 _lowerCAmelCase										=     5
 _lowerCAmelCase										=     [1, 2, 5]
 print(combination_sum_iv(n, array, target))


