


'''simple docstring'''


import copy

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


UpperCAmelCase_	:     Tuple							     =	logging.get_logger(__name__)

UpperCAmelCase_	:     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 					lowercase__						(		_snake_case      ):





							'''simple docstring'''


							A_							:   List[str]   			=						"""musicgen_decoder"""
							A_							:   str   			=						["""past_key_values"""]






							def __init__(					self					,      __snake_case=2048					,      __snake_case=2048					,      __snake_case=24					,      __snake_case=4096					,      __snake_case=16					,      __snake_case=0.0					,      __snake_case=True					,      __snake_case="gelu"					,      __snake_case=1024					,      __snake_case=0.1					,      __snake_case=0.0					,      __snake_case=0.0					,      __snake_case=0.02					,      __snake_case=False					,      __snake_case=4					,      __snake_case=2048					,      __snake_case=2048					,      __snake_case=None					,      __snake_case=False					,      **__snake_case					,      ):
											_SCREAMING_SNAKE_CASE				: Union[str, Any]  	=   vocab_size
											_SCREAMING_SNAKE_CASE				: Dict  	=   max_position_embeddings
											_SCREAMING_SNAKE_CASE				: int  	=   hidden_size
											_SCREAMING_SNAKE_CASE				: Any  	=   ffn_dim
											_SCREAMING_SNAKE_CASE				: Any  	=   num_hidden_layers
											_SCREAMING_SNAKE_CASE				: List[Any]  	=   num_attention_heads
											_SCREAMING_SNAKE_CASE				: Tuple  	=   dropout
											_SCREAMING_SNAKE_CASE				: Union[str, Any]  	=   attention_dropout
											_SCREAMING_SNAKE_CASE				: Optional[Any]  	=   activation_dropout
											_SCREAMING_SNAKE_CASE				: Union[str, Any]  	=   activation_function
											_SCREAMING_SNAKE_CASE				: List[Any]  	=   initializer_factor
											_SCREAMING_SNAKE_CASE				: Tuple  	=   layerdrop
											_SCREAMING_SNAKE_CASE				: Dict  	=   use_cache
											_SCREAMING_SNAKE_CASE				: Any  	=   scale_embedding  # scale factor will be sqrt(d_model) if True
											_SCREAMING_SNAKE_CASE				: str  	=   num_codebooks
											super().__init__(
											    pad_token_id=__lowerCamelCase					,      bos_token_id=__lowerCamelCase					,      eos_token_id=__lowerCamelCase					,      tie_word_embeddings=__lowerCamelCase					,      **__lowerCamelCase					,      )





class 					lowercase__						(		_snake_case      ):





							'''simple docstring'''


							A_							:   List[str]   			=						"""musicgen"""
							A_							:   Optional[int]   			=						True






							def __init__(					self					,      **__snake_case						):
											super().__init__(**__lowerCamelCase						)
											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				: int  	=   kwargs.pop("""text_encoder"""						)
											_SCREAMING_SNAKE_CASE				: Optional[Any]  	=   text_encoder_config.pop("""model_type"""						)

											_SCREAMING_SNAKE_CASE				: Dict  	=   kwargs.pop("""audio_encoder"""						)
											_SCREAMING_SNAKE_CASE				: Tuple  	=   audio_encoder_config.pop("""model_type"""						)

											_SCREAMING_SNAKE_CASE				: List[str]  	=   kwargs.pop("""decoder"""						)

											_SCREAMING_SNAKE_CASE				: List[Any]  	=   AutoConfig.for_model(__lowerCamelCase					,      **__lowerCamelCase						)
											_SCREAMING_SNAKE_CASE				: Union[str, Any]  	=   AutoConfig.for_model(__lowerCamelCase					,      **__lowerCamelCase						)
											_SCREAMING_SNAKE_CASE				: Optional[int]  	=   MusicgenDecoderConfig(**__lowerCamelCase						)
											_SCREAMING_SNAKE_CASE				: List[Any]  	=   True






							@classmethod
							def UpperCAmelCase_			(					cls					,      __snake_case					,      __snake_case					,      __snake_case					,      **__snake_case					,      ):
											return cls(
											    text_encoder=text_encoder_config.to_dict()					,      audio_encoder=audio_encoder_config.to_dict()					,      decoder=decoder_config.to_dict()					,      **__lowerCamelCase					,      )






							def UpperCAmelCase_			(					self						):
											_SCREAMING_SNAKE_CASE				: Optional[Any]  	=   copy.deepcopy(self.__dict__						)
											_SCREAMING_SNAKE_CASE				: Optional[Any]  	=   self.text_encoder.to_dict()
											_SCREAMING_SNAKE_CASE				: Optional[int]  	=   self.audio_encoder.to_dict()
											_SCREAMING_SNAKE_CASE				: Tuple  	=   self.decoder.to_dict()
											_SCREAMING_SNAKE_CASE				: Tuple  	=   self.__class__.model_type
											return output








'''simple docstring'''


def     snake_case_     (						SCREAMING_SNAKE_CASE__							,   SCREAMING_SNAKE_CASE__  ):







				"""simple docstring"""





				return (input_a, input_a).count(0  ) % 2







def     snake_case_     (						):







				"""simple docstring"""





				assert xor_gate(0							,   0  ) == 0
				assert xor_gate(0							,   1  ) == 1
				assert xor_gate(1							,   0  ) == 1
				assert xor_gate(1							,   1  ) == 0


if __name__ == "__main__":
				print(xor_gate(0, 0))
				print(xor_gate(0, 1))




