


'''simple docstring'''

import unittest
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest.mock import Mock, patch

import diffusers.utils.hub_utils







class 			UpperCAmelCase			(							unittest.TestCase):

 @patch("diffusers.utils.hub_utils.get_full_repo_name"       )
 def 		lowercase_    (			self			:						int,       a_			:						Mock       ):





    """simple docstring"""



    UpperCamelCase__			    =    "full_repo_name"
    with TemporaryDirectory() as tmpdir:
       # Dummy args values
       UpperCamelCase__			    =    Mock()
       UpperCamelCase__			    =    tmpdir
       UpperCamelCase__			    =    0
       UpperCamelCase__			    =    "hub_token"
       UpperCamelCase__			    =    "dataset_name"
       UpperCamelCase__			    =    0.01
       UpperCamelCase__			    =    10_0000
       UpperCamelCase__			    =    1_0000
       UpperCamelCase__			    =    0.01
       UpperCamelCase__			    =    0.02
       UpperCamelCase__			    =    0.03
       UpperCamelCase__			    =    0.0_005
       UpperCamelCase__			    =    0.000_001
       UpperCamelCase__			    =    1
       UpperCamelCase__			    =    10
       UpperCamelCase__			    =    0.001
       UpperCamelCase__			    =    0.1
       UpperCamelCase__			    =    0.2
       UpperCamelCase__			    =    True

       # Model card mush be rendered and saved
       diffusers.utils.hub_utils.create_model_card(a_,       model_name="model_name"       )
       self.assertTrue((Path(a_       ) / "README.md").is_file()       )


'''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,       a_			):


							def     _snake_case				(      self)				->					Optional[int]:
								UpperCAmelCase_		:   int													=       load_tool('speech-to-text')
								self.tool.setup()


							def     _snake_case				(      self)				->					Any:
								UpperCAmelCase_		:   str													=       self.tool(torch.ones(3000))
								self.assertEqual(_snake_case     ,      ' you')





							def     _snake_case				(      self)				->					str:
								UpperCAmelCase_		:   List[Any]													=       self.tool(audio=torch.ones(3000))
								self.assertEqual(_snake_case     ,      ' you')






