from transformers import AutoProcessor, MusicgenForConditionalGeneration
processor = AutoProcessor.from_pretrained("facebook/musicgen-small")
model = MusicgenForConditionalGeneration.from_pretrained("facebook/musicgen-small")
inputs = processor(
     text=["80s pop track with bassy drums and synth", "90s rock song with loud guitars and heavy drums"],
     padding=True,
     return_tensors="pt",
 )
audio_values = model.generate(**inputs, do_sample=True, guidance_scale=3, max_new_tokens=256)