


"""simple docstring"""





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

import diffusers.utils.hub_utils

class  lowercase_  ( unittest.TestCase						):







      @patch("diffusers.utils.hub_utils.get_full_repo_name"    )
      def 				_lowerCAmelCase       (      self :							Optional[int]		,  _lowercase :							Mock    ):
        lowerCAmelCase__    :    Tuple								=					"full_repo_name"
        with TemporaryDirectory() as tmpdir:
          # Dummy args values
          lowerCAmelCase__    :    List[str]								=					Mock()
          lowerCAmelCase__    :    Union[str, Any]								=					tmpdir
          lowerCAmelCase__    :    int								=					0
          lowerCAmelCase__    :    Dict								=					"hub_token"
          lowerCAmelCase__    :    Any								=					"dataset_name"
          lowerCAmelCase__    :    List[str]								=					0.01
          lowerCAmelCase__    :    Any								=					1_0_0_0_0_0
          lowerCAmelCase__    :    Dict								=					1_0_0_0_0
          lowerCAmelCase__    :    Optional[Any]								=					0.01
          lowerCAmelCase__    :    str								=					0.02
          lowerCAmelCase__    :    int								=					0.03
          lowerCAmelCase__    :    Any								=					0.0005
          lowerCAmelCase__    :    Optional[int]								=					0.00_0001
          lowerCAmelCase__    :    List[str]								=					1
          lowerCAmelCase__    :    str								=					1_0
          lowerCAmelCase__    :    Dict								=					0.001
          lowerCAmelCase__    :    int								=					0.1
          lowerCAmelCase__    :    List[str]								=					0.2
          lowerCAmelCase__    :    Dict								=					True

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




"""simple docstring"""





from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCAmelCase    				=      {"configuration_sew_d": ["SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP", "SEWDConfig"]}

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   __UpperCAmelCase    				=      [
       "SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST",
       "SEWDForCTC",
       "SEWDForSequenceClassification",
       "SEWDModel",
       "SEWDPreTrainedModel",
   ]

if TYPE_CHECKING:
   from .configuration_sew_d import SEW_D_PRETRAINED_CONFIG_ARCHIVE_MAP, SEWDConfig

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_sew_d import (
          SEW_D_PRETRAINED_MODEL_ARCHIVE_LIST,
          SEWDForCTC,
          SEWDForSequenceClassification,
          SEWDModel,
          SEWDPreTrainedModel,
      )


else:
   import sys

   __UpperCAmelCase    				=      _LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
