'''simple docstring'''




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     __magic_name__						(    unittest.TestCase,     _UpperCAmelCase):







			def 	SCREAMING_SNAKE_CASE_     (	self				:  Optional[Any]    ):
										lowercase_					:			List[str]										=       load_tool("""text-to-speech"""    )
										self.tool.setup()







			def 	SCREAMING_SNAKE_CASE_     (	self				:  List[Any]    ):
										# SpeechT5 isn't deterministic
										torch.manual_seed(0    )
										lowercase_					:			List[str]										=       self.tool("""hey"""    )
										lowercase_					:			Optional[int]										=       result.to_raw()
										self.assertTrue(
										    torch.allclose(
										        resulting_tensor[:3]				,			torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]    )				,			)    )







			def 	SCREAMING_SNAKE_CASE_     (	self				:  List[Any]    ):
										# SpeechT5 isn't deterministic
										torch.manual_seed(0    )
										lowercase_					:			Union[str, Any]										=       self.tool("""hey"""    )
										lowercase_					:			int										=       result.to_raw()
										self.assertTrue(
										    torch.allclose(
										        resulting_tensor[:3]				,			torch.tensor([-0.0_00_59_66_66_88_32_11_58_29, -0.0_00_36_57_64_01_90_79_50_64, -0.00_01_34_39_50_27_99_88_34_85]    )				,			)    )






'''simple docstring'''




from typing import TYPE_CHECKING

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


_lowercase						: Dict						=						{"configuration_mmbt": ["MMBTConfig"]}

try:
						if not is_torch_available():
												raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
						pass
else:
						_lowercase						: Dict						=						["MMBTForClassification", "MMBTModel", "ModalEmbeddings"]


if TYPE_CHECKING:
						from .configuration_mmbt import MMBTConfig

						try:
												if not is_torch_available():
																		raise OptionalDependencyNotAvailable()
						except OptionalDependencyNotAvailable:
												pass
						else:
												from .modeling_mmbt import MMBTForClassification, MMBTModel, ModalEmbeddings

else:
						import sys

						_lowercase						: Optional[int]						=						_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)





