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

import diffusers.utils.hub_utils





class 							A__	(			unittest.TestCase):
      @patch("""diffusers.utils.hub_utils.get_full_repo_name"""   )
      def 		UpperCamelCase__							(   self					,						__magic_name__   ):
       lowerCamelCase	:			Dict           =   """full_repo_name"""
       with TemporaryDirectory() as tmpdir:
        # Dummy args values
        lowerCamelCase	:			str           =   Mock()
        lowerCamelCase	:			List[Any]           =   tmpdir
        lowerCamelCase	:			List[Any]           =   0
        lowerCamelCase	:			int           =   """hub_token"""
        lowerCamelCase	:			Optional[Any]           =   """dataset_name"""
        lowerCamelCase	:			int           =   0.01
        lowerCamelCase	:			str           =   1_0_0_0_0_0
        lowerCamelCase	:			Any           =   1_0_0_0_0
        lowerCamelCase	:			int           =   0.01
        lowerCamelCase	:			Tuple           =   0.02
        lowerCamelCase	:			Optional[int]           =   0.03
        lowerCamelCase	:			Dict           =   0.0_005
        lowerCamelCase	:			Optional[int]           =   0.000_001
        lowerCamelCase	:			Dict           =   1
        lowerCamelCase	:			Dict           =   1_0
        lowerCamelCase	:			Any           =   0.001
        lowerCamelCase	:			int           =   0.1
        lowerCamelCase	:			Dict           =   0.2
        lowerCamelCase	:			Tuple           =   True

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






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCamelCase           ={
    """configuration_musicgen""": [
        """MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """MusicgenConfig""",
        """MusicgenDecoderConfig""",
    ],
    """processing_musicgen""": ["""MusicgenProcessor"""],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _lowerCamelCase           =[
          """MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """MusicgenForConditionalGeneration""",
          """MusicgenForCausalLM""",
          """MusicgenModel""",
          """MusicgenPreTrainedModel""",
      ]

if TYPE_CHECKING:
      from .configuration_musicgen import (
          MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP,
          MusicgenConfig,
          MusicgenDecoderConfig,
      )
      from .processing_musicgen import MusicgenProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_musicgen import (
                MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST,
                MusicgenForCausalLM,
                MusicgenForConditionalGeneration,
                MusicgenModel,
                MusicgenPreTrainedModel,
            )

else:
      import sys

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




