

"""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 				SCREAMING_SNAKE_CASE					(		unittest.TestCase    ,							a_       ):






					"""simple docstring"""



					def        __lowerCAmelCase (       self			:				int		):
						lowerCAmelCase__	:						Dict  				=	load_tool('''text-to-speech'''		)
						self.tool.setup()







					def        __lowerCAmelCase (       self			:				Any		):
						# SpeechT5 isn't deterministic
						torch.manual_seed(0		)
						lowerCAmelCase__	:						Dict  				=	self.tool('''hey'''		)
						lowerCAmelCase__	:						Optional[Any]  				=	result.to_raw()
						self.assertTrue(
						    torch.allclose(
						        resulting_tensor[:3]   ,torch.tensor([-0.000_5966_6688_3211_5829, -0.000_3657_6401_9079_5064, -0.0001_3439_5027_9988_3485]		)   ,)		)







					def        __lowerCAmelCase (       self			:				List[str]		):
						# SpeechT5 isn't deterministic
						torch.manual_seed(0		)
						lowerCAmelCase__	:						List[str]  				=	self.tool('''hey'''		)
						lowerCAmelCase__	:						Dict  				=	result.to_raw()
						self.assertTrue(
						    torch.allclose(
						        resulting_tensor[:3]   ,torch.tensor([-0.000_5966_6688_3211_5829, -0.000_3657_6401_9079_5064, -0.0001_3439_5027_9988_3485]		)   ,)		)











def   a_    ( lowerCAmelCase_      :			int	):
   if number < 0:
      raise ValueError('number must not be negative'	)
   return number & (number - 1) == 0


if __name__ == "__main__":
     import doctest

     doctest.testmod()

