





import unittest

from transformers import load_tool
from transformers.utils import is_torch_available


if is_torch_available():
  import torch

from transformers.testing_utils import require_torch

from .test_tools_common import ToolTesterMixin







@require_torch
class   __lowerCAmelCase			(					unittest.TestCase		,_UpperCamelCase  ):





   def 	_snake_case ( self      )				->  Optional[Any]:
      """simple docstring"""





      a__	:						int      		=  load_tool("text-to-speech"      )
      self.tool.setup()





   def 	_snake_case ( self      )				->  int:
      """simple docstring"""





      torch.manual_seed(0      )
      a__	:						Union[str, Any]      		=  self.tool("hey"      )
      a__	:						str      		=  result.to_raw()
      self.assertTrue(
          torch.allclose(
              resulting_tensor[:3]					,			torch.tensor([-0.0_005_966_668_832_115_829, -0.0_003_657_640_190_795_064, -0.00_013_439_502_799_883_485]      )					,			)      )





   def 	_snake_case ( self      )				->  List[Any]:
      """simple docstring"""





      torch.manual_seed(0      )
      a__	:						str      		=  self.tool("hey"      )
      a__	:						List[Any]      		=  result.to_raw()
      self.assertTrue(
          torch.allclose(
              resulting_tensor[:3]					,			torch.tensor([-0.0_005_966_668_832_115_829, -0.0_003_657_640_190_795_064, -0.00_013_439_502_799_883_485]      )					,			)      )








from typing import TYPE_CHECKING

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


SCREAMING_SNAKE_CASE__       :			List[str]			      =						{"""configuration_van""": ["""VAN_PRETRAINED_CONFIG_ARCHIVE_MAP""", """VanConfig"""]}


try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  SCREAMING_SNAKE_CASE__       :			Optional[int]			      =						[
      """VAN_PRETRAINED_MODEL_ARCHIVE_LIST""",
      """VanForImageClassification""",
      """VanModel""",
      """VanPreTrainedModel""",
  ]

if TYPE_CHECKING:
  from .configuration_van import VAN_PRETRAINED_CONFIG_ARCHIVE_MAP, VanConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_van import (
        VAN_PRETRAINED_MODEL_ARCHIVE_LIST,
        VanForImageClassification,
        VanModel,
        VanPreTrainedModel,
    )

else:
  import sys

  SCREAMING_SNAKE_CASE__       :			List[str]			      =						_LazyModule(__name__, globals()["""__file__"""], _import_structure)

