

"""simple docstring"""




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__)



import os
import unittest

import pytest
from parameterized import parameterized

from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device


# skipping in unittest tests

lowerCamelCase									= [(1,)]




def       UpperCAmelCase__    (      ):





  '''simple docstring'''







  a__  =bool(os.getenv('''RUN_SLOW'''     ,				0							)							)
  if run_slow:
    assert True
  else:
    assert False, "should have been skipped"




def       UpperCAmelCase__    (      ):





  '''simple docstring'''







  a__  =bool(os.getenv('''RUN_SLOW'''     ,				0							)							)
  if run_slow and torch_device == "cuda":
    assert True
  else:
    assert False, "should have been skipped"







@require_torch
class 						__magic_name__      (							unittest.TestCase							):

   '''simple docstring'''




   @slow
   @require_torch_gpu
   def 			_UpperCAmelCase			(    self	)							->   Union[str, Any]:






     """simple docstring"""






     check_slow_torch_cuda()



   @require_torch_gpu
   @slow
   def 			_UpperCAmelCase			(    self	)							->   List[str]:






     """simple docstring"""






     check_slow_torch_cuda()



   @parameterized.expand(lowercase_	)
   @slow
   def 			_UpperCAmelCase			(    self,   lowercase_=None	)							->   Tuple:






     """simple docstring"""






     check_slow()





@slow
@require_torch_gpu
def       UpperCAmelCase__    (      ):





  '''simple docstring'''







  check_slow_torch_cuda()




@require_torch_gpu
@slow
def       UpperCAmelCase__    (      ):





  '''simple docstring'''







  check_slow_torch_cuda()




@slow
@pytest.mark.parametrize('''param'''     ,				[1]							)
def       UpperCAmelCase__    (      _A				:			str							):





  '''simple docstring'''







  check_slow()




@pytest.mark.parametrize('''param'''     ,				[1]							)
@slow
def       UpperCAmelCase__    (      _A				:			Tuple							):





  '''simple docstring'''







  check_slow()
