mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-23 16:46:52 +08:00
![]() * Update README.md A small typo was fixed in the musicgen README.md. * Update musicgen/README.md --------- Co-authored-by: Awni Hannun <awni.hannun@gmail.com> |
||
---|---|---|
.. | ||
benchmarks | ||
encodec.py | ||
generate.py | ||
musicgen.py | ||
README.md | ||
requirements.txt | ||
t5.py | ||
utils.py |
MusicGen
An example of Meta's MusicGen model in MLX.1 MusicGen is used to generate music from text descriptions.
Setup
Install the requirements:
pip install -r requirements.txt
Example
An example using the model:
from musicgen import MusicGen
from utils import save_audio
model = MusicGen.from_pretrained("facebook/musicgen-medium")
audio = model.generate("happy rock")
save_audio("out.wav", audio, model.sampling_rate)
-
Refer to the arXiv paper and code for more details. ↩︎