ml-explore / mlx-examples

Examples in the MLX framework
MIT License
6.26k stars 892 forks source link

Musicgen Duration, Stereo, Melody #1058

Open chigkim opened 1 month ago

chigkim commented 1 month ago

It's awesome to see MusicGen on MMLX. Can we have the duration parameter to set how long the generated audio should be. The original musicgen has: model.set_generation_params(duration=8) # generate 8 seconds. Also it has model for stereo as well as feeding your own audio melody. It would be great for MLX Musicgen to support those models. Thanks!

barronalex commented 1 month ago

As a work around you can use the max_steps argument to the generate script to set the duration. There are ~50 steps per second e.g max_steps=200 generates about 4 seconds of audio.

Agreed, it would be great to have stereo support and audio conditioning! I might take a look later this week.