




import copy

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


__A    :				str    						=	logging.get_logger(__name__)

__A    :				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       UpperCAmelCase_   ( A							):




							'''simple docstring'''



							a__    	=  '''musicgen_decoder'''
							a__    	=  ['''past_key_values''']





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





class       UpperCAmelCase_   ( A							):




							'''simple docstring'''



							a__    	=  '''musicgen'''
							a__    	=  True





							def __init__(       self							:						Optional[Any]							,  **a							:						Dict      )      ->       List[Any]:
										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"""      )

										SCREAMING_SNAKE_CASE     =       kwargs.pop("""text_encoder"""      )
										SCREAMING_SNAKE_CASE     =       text_encoder_config.pop("""model_type"""      )

										SCREAMING_SNAKE_CASE     =       kwargs.pop("""audio_encoder"""      )
										SCREAMING_SNAKE_CASE     =       audio_encoder_config.pop("""model_type"""      )

										SCREAMING_SNAKE_CASE     =       kwargs.pop("""decoder"""      )

										SCREAMING_SNAKE_CASE     =       AutoConfig.for_model(a							,  **a      )
										SCREAMING_SNAKE_CASE     =       AutoConfig.for_model(a							,  **a      )
										SCREAMING_SNAKE_CASE     =       MusicgenDecoderConfig(**a      )
										SCREAMING_SNAKE_CASE     =       True





							@classmethod
							def  _UpperCAmelCase  (       cls							:						Union[str, Any]							,  a							:						PretrainedConfig							,  a							:						PretrainedConfig							,  a							:						MusicgenDecoderConfig							,  **a							:						int							,  )      ->       List[Any]:
										return cls(
										    text_encoder=text_encoder_config.to_dict()							,  audio_encoder=audio_encoder_config.to_dict()							,  decoder=decoder_config.to_dict()							,  **a							,  )







							def  _UpperCAmelCase  (       self							:						Optional[int]      )      ->       Tuple:
										SCREAMING_SNAKE_CASE     =       copy.deepcopy(self.__dict__      )
										SCREAMING_SNAKE_CASE     =       self.text_encoder.to_dict()
										SCREAMING_SNAKE_CASE     =       self.audio_encoder.to_dict()
										SCREAMING_SNAKE_CASE     =       self.decoder.to_dict()
										SCREAMING_SNAKE_CASE     =       self.__class__.model_type
										return output












def        lowerCamelCase_     (     SCREAMING_SNAKE_CASE       ,						SCREAMING_SNAKE_CASE ):
			'''simple docstring'''
			if n == 0:
						return 1

			elif n % 2 == 1:
						return binary_exponentiation(SCREAMING_SNAKE_CASE       ,						n - 1 ) * a

			else:
						SCREAMING_SNAKE_CASE     =       binary_exponentiation(SCREAMING_SNAKE_CASE       ,						n / 2 )
						return b * b


if __name__ == "__main__":
		try:
				__A    :				Tuple    						=	int(input("""Enter Base : """).strip())
				__A    :				Any    						=	int(input("""Enter Power : """).strip())
		except ValueError:
				print("""Invalid literal for integer""")

		__A    :				Union[str, Any]    						=	binary_exponentiation(BASE, POWER)
		print(f'''{BASE}^({POWER}) : {RESULT}''')






