




'''simple docstring'''







import copy

from ...configuration_utils import PretrainedConfig
from ...utils import logging
from ..auto.configuration_auto import AutoConfig


lowercase			:      List[str]			=					logging.get_logger(__name__)

lowercase			:      Optional[Any]			=					{
    """facebook/musicgen-small""": """https://huggingface.co/facebook/musicgen-small/resolve/main/config.json""",
    # See all Musicgen models at https://huggingface.co/models?filter=musicgen
}







class 				_a   (a__  ):





     '''simple docstring'''



     lowerCAmelCase_     :    List[str]									=				"""musicgen_decoder"""
     lowerCAmelCase_     :    Optional[Any]									=				["""past_key_values"""]







     def __init__(							self       ,__a=2_048       ,__a=2_048       ,__a=24       ,__a=4_096       ,__a=16       ,__a=0.0       ,__a=True       ,__a="gelu"       ,__a=1_024       ,__a=0.1       ,__a=0.0       ,__a=0.0       ,__a=0.02       ,__a=False       ,__a=4       ,__a=2_048       ,__a=2_048       ,__a=None       ,__a=False       ,**__a       ,)			->							int:
          snake_case :			Optional[int]					   = vocab_size
          snake_case :			Dict					   = max_position_embeddings
          snake_case :			Tuple					   = hidden_size
          snake_case :			int					   = ffn_dim
          snake_case :			List[str]					   = num_hidden_layers
          snake_case :			str					   = num_attention_heads
          snake_case :			Optional[int]					   = dropout
          snake_case :			Dict					   = attention_dropout
          snake_case :			Union[str, Any]					   = activation_dropout
          snake_case :			List[str]					   = activation_function
          snake_case :			Optional[int]					   = initializer_factor
          snake_case :			str					   = layerdrop
          snake_case :			Union[str, Any]					   = use_cache
          snake_case :			Optional[int]					   = scale_embedding  # scale factor will be sqrt(d_model) if True
          snake_case :			List[str]					   = num_codebooks
          super().__init__(
              pad_token_id=__a       ,bos_token_id=__a       ,eos_token_id=__a       ,tie_word_embeddings=__a       ,**__a       ,)







class 				_a   (a__  ):





     '''simple docstring'''



     lowerCAmelCase_     :    Tuple									=				"""musicgen"""
     lowerCAmelCase_     :    Tuple									=				True







     def __init__(							self       ,**__a       )			->							Tuple:
          super().__init__(**__a       )
          if "text_encoder" not in kwargs or "audio_encoder" not in kwargs or "decoder" not in kwargs:
               raise ValueError("""Config has to be initialized with text_encoder, audio_encoder and decoder config"""       )

          snake_case :			List[Any]					   = kwargs.pop("""text_encoder"""       )
          snake_case :			Optional[int]					   = text_encoder_config.pop("""model_type"""       )

          snake_case :			Any					   = kwargs.pop("""audio_encoder"""       )
          snake_case :			Tuple					   = audio_encoder_config.pop("""model_type"""       )

          snake_case :			Optional[Any]					   = kwargs.pop("""decoder"""       )

          snake_case :			Dict					   = AutoConfig.for_model(__a       ,**__a       )
          snake_case :			str					   = AutoConfig.for_model(__a       ,**__a       )
          snake_case :			Tuple					   = MusicgenDecoderConfig(**__a       )
          snake_case :			int					   = True







     @classmethod
     def  snake_case_			(							cls       ,__a       ,__a       ,__a       ,**__a       ,)			->							Dict:
          return cls(
              text_encoder=text_encoder_config.to_dict()       ,audio_encoder=audio_encoder_config.to_dict()       ,decoder=decoder_config.to_dict()       ,**__a       ,)







     def  snake_case_			(							self       )			->							str:
          snake_case :			Any					   = copy.deepcopy(self.__dict__       )
          snake_case :			int					   = self.text_encoder.to_dict()
          snake_case :			int					   = self.audio_encoder.to_dict()
          snake_case :			Union[str, Any]					   = self.decoder.to_dict()
          snake_case :			str					   = self.__class__.model_type
          return output









'''simple docstring'''







def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) * 9 / 5) + 32    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round(float(__lowercase							) + 273.15    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) * 9 / 5) + 491.67    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) - 32) * 5 / 9    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round(((float(__lowercase							) - 32) * 5 / 9) + 273.15    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round(float(__lowercase							) + 459.67    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round(float(__lowercase							) - 273.15    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round(((float(__lowercase							) - 273.15) * 9 / 5) + 32    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) * 9 / 5)    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) - 491.67) * 5 / 9    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round(float(__lowercase							) - 459.67    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) * 5 / 9)    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) * 1.25 + 273.15)    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) * 2.25 + 32)    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) * 1.25)    ,      __lowercase							)



def 					lowerCamelCase__							(			__lowercase    ,      __lowercase = 2							):
     return round((float(__lowercase							) * 2.25 + 32 + 459.67)    ,      __lowercase							)


if __name__ == "__main__":
      import doctest

      doctest.testmod()



