
"""simple docstring"""

import unittest

from transformers import is_torch_available, load_tool

from .test_tools_common import ToolTesterMixin


if is_torch_available():
					import torch






class        _lowercase   (				unittest.TestCase				,       __UpperCAmelCase		):




	def 			_UpperCamelCase    ( self					)		->							List[str]:
			lowerCamelCase     :			Optional[Any]		=    load_tool('speech-to-text'					)
			self.tool.setup()




	def 			_UpperCamelCase    ( self					)		->							List[str]:
			lowerCamelCase     :			Tuple		=    self.tool(torch.ones(3000					)					)
			self.assertEqual(UpperCAmelCase_		, ' you'					)




	def 			_UpperCamelCase    ( self					)		->							Tuple:
			lowerCamelCase     :			Any		=    self.tool(audio=torch.ones(3000					)					)
			self.assertEqual(UpperCAmelCase_		, ' you'					)













"""simple docstring"""
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tokenizers_available, is_torch_available


__UpperCamelCase			:		List[Any]		    =   {'''configuration_yoso''': ['''YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''YosoConfig''']}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __UpperCamelCase			:		Dict		    =   [
           '''YOSO_PRETRAINED_MODEL_ARCHIVE_LIST''',
           '''YosoForMaskedLM''',
           '''YosoForMultipleChoice''',
           '''YosoForQuestionAnswering''',
           '''YosoForSequenceClassification''',
           '''YosoForTokenClassification''',
           '''YosoLayer''',
           '''YosoModel''',
           '''YosoPreTrainedModel''',
       ]


if TYPE_CHECKING:
       from .configuration_yoso import YOSO_PRETRAINED_CONFIG_ARCHIVE_MAP, YosoConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_yoso import (
                  YOSO_PRETRAINED_MODEL_ARCHIVE_LIST,
                  YosoForMaskedLM,
                  YosoForMultipleChoice,
                  YosoForQuestionAnswering,
                  YosoForSequenceClassification,
                  YosoForTokenClassification,
                  YosoLayer,
                  YosoModel,
                  YosoPreTrainedModel,
              )


else:
       import sys

       __UpperCamelCase			:		Any		    =   _LazyModule(__name__, globals()['''__file__'''], _import_structure)





