soapboxguy/MusicGen
0
1---2title: "MusicGen"3python_version: "3.9"4tags:5 - "music generation"6 - "language models"7 - "LLMs"8app_file: "demos/musicgen_app.py"9emoji: 🎵10colorFrom: gray11colorTo: blue12sdk: gradio13sdk_version: 3.34.014pinned: true15license: "cc-by-nc-4.0"16---17# AudioCraft18192021 22AudioCraft is a PyTorch library for deep learning research on audio generation. AudioCraft contains inference and training code23for two state-of-the-art AI generative models producing high-quality audio: AudioGen and MusicGen.24 25 26## Installation27AudioCraft requires Python 3.9, PyTorch 2.0.0. To install AudioCraft, you can run the following:28 29```shell30# Best to make sure you have torch installed first, in particular before installing xformers.31# Don't run this if you already have PyTorch installed.32pip install 'torch>=2.0'33# Then proceed to one of the following34pip install -U audiocraft # stable release35pip install -U git+https://git@github.com/facebookresearch/audiocraft#egg=audiocraft # bleeding edge36pip install -e . # or if you cloned the repo locally (mandatory if you want to train).37```38 39We also recommend having `ffmpeg` installed, either through your system or Anaconda:40```bash41sudo apt-get install ffmpeg42# Or if you are using Anaconda or Miniconda43conda install "ffmpeg<5" -c conda-forge44```45 46## Models47 48At the moment, AudioCraft contains the training code and inference code for:49* [MusicGen](./docs/MUSICGEN.md): A state-of-the-art controllable text-to-music model.50* [AudioGen](./docs/AUDIOGEN.md): A state-of-the-art text-to-sound model.51* [EnCodec](./docs/ENCODEC.md): A state-of-the-art high fidelity neural audio codec.52* [Multi Band Diffusion](./docs/MBD.md): An EnCodec compatible decoder using diffusion.53 54## Training code55 56AudioCraft contains PyTorch components for deep learning research in audio and training pipelines for the developed models.57For a general introduction of AudioCraft design principles and instructions to develop your own training pipeline, refer to58the [AudioCraft training documentation](./docs/TRAINING.md).59 60For reproducing existing work and using the developed training pipelines, refer to the instructions for each specific model61that provides pointers to configuration, example grids and model/task-specific information and FAQ.62 63 64## API documentation65 66We provide some [API documentation](https://facebookresearch.github.io/audiocraft/api_docs/audiocraft/index.html) for AudioCraft.67 68 69## FAQ70 71#### Is the training code available?72 73Yes! We provide the training code for [EnCodec](./docs/ENCODEC.md), [MusicGen](./docs/MUSICGEN.md) and [Multi Band Diffusion](./docs/MBD.md).74 75#### Where are the models stored?76 77Hugging Face stored the model in a specific location, which can be overriden by setting the `AUDIOCRAFT_CACHE_DIR` environment variable for the AudioCraft models.78In order to change the cache location of the other Hugging Face models, please check out the [Hugging Face Transformers documentation for the cache setup](https://huggingface.co/docs/transformers/installation#cache-setup).79Finally, if you use a model that relies on Demucs (e.g. `musicgen-melody`) and want to change the download location for Demucs, refer to the [Torch Hub documentation](https://pytorch.org/docs/stable/hub.html#where-are-my-downloaded-models-saved).80 81 82## License83* The code in this repository is released under the MIT license as found in the [LICENSE file](LICENSE).84* The models weights in this repository are released under the CC-BY-NC 4.0 license as found in the [LICENSE_weights file](LICENSE_weights).85 86 87## Citation88 89For the general framework of AudioCraft, please cite the following.90```91@article{copet2023simple,92 title={Simple and Controllable Music Generation},93 author={Jade Copet and Felix Kreuk and Itai Gat and Tal Remez and David Kant and Gabriel Synnaeve and Yossi Adi and Alexandre Défossez},94 year={2023},95 journal={arXiv preprint arXiv:2306.05284},96}97```98 99When referring to a specific model, please cite as mentioned in the model specific README, e.g100[./docs/MUSICGEN.md](./docs/MUSICGEN.md), [./docs/AUDIOGEN.md](./docs/AUDIOGEN.md), etc.101 