audiocraft README

The project's README from github.com/facebookresearch/audiocraft. As one markdown file: README.md.

AudioCraft

docs badge linter badge tests badge

AudioCraft is a PyTorch library for deep learning research on audio generation. AudioCraft contains inference and training code for two state-of-the-art AI generative models producing high-quality audio: AudioGen and MusicGen.

Installation

AudioCraft requires Python 3.9, PyTorch 2.1.0. To install AudioCraft, you can run the following:

# Best to make sure you have torch installed first, in particular before installing xformers.
# Don't run this if you already have PyTorch installed.
python -m pip install 'torch==2.1.0'
# You might need the following before trying to install the packages
python -m pip install setuptools wheel
# Then proceed to one of the following
python -m pip install -U audiocraft  # stable release
python -m pip install -U git+https://[email protected]/facebookresearch/audiocraft#egg=audiocraft  # bleeding edge
python -m pip install -e .  # or if you cloned the repo locally (mandatory if you want to train).
python -m pip install -e '.[wm]'  # if you want to train a watermarking model

We also recommend having ffmpeg installed, either through your system or Anaconda:

sudo apt-get install ffmpeg
# Or if you are using Anaconda or Miniconda
conda install "ffmpeg<5" -c conda-forge

Models

At the moment, AudioCraft contains the training code and inference code for:

Training code

AudioCraft contains PyTorch components for deep learning research in audio and training pipelines for the developed models. For a general introduction of AudioCraft design principles and instructions to develop your own training pipeline, refer to the AudioCraft training documentation.

For reproducing existing work and using the developed training pipelines, refer to the instructions for each specific model that provides pointers to configuration, example grids and model/task-specific information and FAQ.

API documentation

We provide some API documentation for AudioCraft.

FAQ

Is the training code available?

Yes! We provide the training code for EnCodec, MusicGen,Multi Band Diffusion and JASCO.

Where are the models stored?

Hugging Face stored the model in a specific location, which can be overridden by setting the AUDIOCRAFT_CACHE_DIR environment variable for the AudioCraft models. In order to change the cache location of the other Hugging Face models, please check out the Hugging Face Transformers documentation for the cache setup. Finally, 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.

License

Citation

For the general framework of AudioCraft, please cite the following.

@inproceedings{copet2023simple,
    title={Simple and Controllable Music Generation},
    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},
    booktitle={Thirty-seventh Conference on Neural Information Processing Systems},
    year={2023},
}

When referring to a specific model, please cite as mentioned in the model specific README, e.g ./docs/MUSICGEN.md, ./docs/AUDIOGEN.md, etc.

audiocraft (facebookresearch/audiocraft)

Searching Database…

What is this?AudioCraft is a PyTorch library for deep learning research on audio generation, built around generative models like MusicGen (text-to-music) and AudioGen (text-to-sound), plus the EnCodec neural audio codec.
Is this a ready-to-use app or a research codebase?It's a research library with PyTorch components, inference scripts, and training pipelines that you run as Python code rather than a packaged application.
How do I install and start using it?Install Python 3.9 with PyTorch 2.1.0, run the pip install command from the README's Installation section, and also install ffmpeg (via your system or Anaconda) for audio handling.
Does it include pretrained weights I can use right away?Yes - models are loaded through Hugging Face, which automatically downloads and caches the pretrained weights the first time you run a model.
Is training code available for every model listed?No - full training code is only provided for EnCodec, MusicGen, Multi Band Diffusion, and JASCO, so other listed models ship with inference code but not a complete training pipeline here.
What is MusicGen?MusicGen is AudioCraft's flagship model: a controllable text-to-music language model that can also be conditioned on a melody.
What is EnCodec used for?EnCodec is AudioCraft's neural audio codec/tokenizer that compresses raw audio into tokens the generative models work with.
What does AudioSeal do?AudioSeal is an audio watermarking model included in AudioCraft for marking and detecting AI-generated audio.
What is MAGNeT?MAGNeT is AudioCraft's non-autoregressive model for faster text-to-music and text-to-sound generation compared to the standard LM-based models.
Size
24.4 MB
Stars
23.7K
Updated
CommitMar 13
Age
3y
Commits · 90 Days