





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

import diffusers.utils.hub_utils
class SCREAMING_SNAKE_CASE_    (       unittest.TestCase       ):






						@patch('diffusers.utils.hub_utils.get_full_repo_name'						)
						def UpperCAmelCase_					(   self   :   Optional[int]		, _A   :   Mock						)				->     None:







							"""simple docstring"""


							snake_case_		:      Optional[Any]           =						'full_repo_name'
							with TemporaryDirectory() as tmpdir:
								# Dummy args values
								snake_case_		:      Optional[int]           =						Mock()
								snake_case_		:      Union[str, Any]           =						tmpdir
								snake_case_		:      Optional[Any]           =						0
								snake_case_		:      Union[str, Any]           =						'hub_token'
								snake_case_		:      Any           =						'dataset_name'
								snake_case_		:      Tuple           =						0.0_1
								snake_case_		:      Dict           =						100000
								snake_case_		:      Any           =						10000
								snake_case_		:      str           =						0.0_1
								snake_case_		:      Any           =						0.0_2
								snake_case_		:      Optional[Any]           =						0.0_3
								snake_case_		:      Tuple           =						0.0_0_0_5
								snake_case_		:      Tuple           =						0.0_0_0_0_0_1
								snake_case_		:      str           =						1
								snake_case_		:      Optional[int]           =						10
								snake_case_		:      List[str]           =						0.0_0_1
								snake_case_		:      Any           =						0.1
								snake_case_		:      List[str]           =						0.2
								snake_case_		:      Dict           =						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"""


from typing import TYPE_CHECKING

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


a__       :  List[Any]       		=					{
    """configuration_realm""": ["""REALM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """RealmConfig"""],
    """tokenization_realm""": ["""RealmTokenizer"""],
}

try:
   if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   a__       :  Union[str, Any]       		=					["""RealmTokenizerFast"""]

try:
   if not is_torch_available():
      raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
   pass
else:
   a__       :  Dict       		=					[
       """REALM_PRETRAINED_MODEL_ARCHIVE_LIST""",
       """RealmEmbedder""",
       """RealmForOpenQA""",
       """RealmKnowledgeAugEncoder""",
       """RealmPreTrainedModel""",
       """RealmReader""",
       """RealmScorer""",
       """load_tf_weights_in_realm""",
   ]
   a__       :  Any       		=					["""RealmRetriever"""]


if TYPE_CHECKING:
   from .configuration_realm import REALM_PRETRAINED_CONFIG_ARCHIVE_MAP, RealmConfig
   from .tokenization_realm import RealmTokenizer

   try:
      if not is_tokenizers_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .tokenization_realm import RealmTokenizerFast

   try:
      if not is_torch_available():
         raise OptionalDependencyNotAvailable()
   except OptionalDependencyNotAvailable:
      pass
   else:
      from .modeling_realm import (
          REALM_PRETRAINED_MODEL_ARCHIVE_LIST,
          RealmEmbedder,
          RealmForOpenQA,
          RealmKnowledgeAugEncoder,
          RealmPreTrainedModel,
          RealmReader,
          RealmScorer,
          load_tf_weights_in_realm,
      )
      from .retrieval_realm import RealmRetriever


else:
   import sys

   a__       :  Any       		=					_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)

