audiocraft icon indicating copy to clipboard operation
audiocraft copied to clipboard

Using musicgen-melody model in Transformers library

Open ukemamaster opened this issue 1 year ago • 2 comments

Is it possible to use the musicgen-melody model in the Transformers library like the musicgen-small model ?

I gave it a try :

from transformers import AutoProcessor, MusicgenForConditionalGeneration


processor = AutoProcessor.from_pretrained("facebook/musicgen-melody")
model = MusicgenForConditionalGeneration.from_pretrained("facebook/musicgen-melody)

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, max_new_tokens=256)

But it seems like the musicgen-melody model is not supported by the Transformers library, and i get the following error:

raise EnvironmentError(
OSError: facebook/musicgen-melody does not appear to have a file named config.json. 
Checkout 'https://huggingface.co/facebook/musicgen-melody/main' for available files.

ukemamaster avatar Jan 30 '24 08:01 ukemamaster

hi friend did you find out

xinyueli2896 avatar Mar 19 '24 15:03 xinyueli2896

hi, have you solved the issue?

kenkalang avatar Sep 14 '24 13:09 kenkalang