-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
586 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,11 @@ AudioCraft requires Python 3.9, PyTorch 2.0.0. To install AudioCraft, you can ru | |
```shell | ||
# Best to make sure you have torch installed first, in particular before installing xformers. | ||
# Don't run this if you already have PyTorch installed. | ||
pip install 'torch>=2.0' | ||
python -m pip install 'torch>=2.0' | ||
# Then proceed to one of the following | ||
pip install -U audiocraft # stable release | ||
pip install -U git+https://[email protected]/facebookresearch/audiocraft#egg=audiocraft # bleeding edge | ||
pip install -e . # or if you cloned the repo locally (mandatory if you want to train). | ||
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). | ||
``` | ||
|
||
We also recommend having `ffmpeg` installed, either through your system or Anaconda: | ||
|
@@ -72,11 +72,11 @@ Finally, if you use a model that relies on Demucs (e.g. `musicgen-melody`) and w | |
|
||
For the general framework of AudioCraft, please cite the following. | ||
``` | ||
@article{copet2023simple, | ||
@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}, | ||
journal={arXiv preprint arXiv:2306.05284}, | ||
} | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ | |
# flake8: noqa | ||
from . import data, modules, models | ||
|
||
__version__ = '1.0.0' | ||
__version__ = '1.2.0a1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
audiocraft/grids/musicgen/musicgen_stereo_finetune_32khz.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
from pathlib import Path | ||
from ._explorers import LMExplorer | ||
from ...environment import AudioCraftEnvironment | ||
|
||
|
||
@LMExplorer | ||
def explorer(launcher): | ||
partitions = AudioCraftEnvironment.get_slurm_partitions(['team', 'global']) | ||
launcher.slurm_(gpus=32, partition=partitions) | ||
launcher.bind_(solver='musicgen/musicgen_base_32khz') | ||
# replace this by the desired music dataset, which needs to be stereo | ||
launcher.bind_(dset='audio/example') | ||
|
||
fsdp = {'autocast': False, 'fsdp.use': True} | ||
medium = {'model/lm/model_scale': 'medium'} | ||
large = {'model/lm/model_scale': 'large'} | ||
|
||
cfg_low = {'classifier_free_guidance.training_dropout': 0.2} | ||
wd_low = {'conditioners.description.t5.word_dropout': 0.2} | ||
|
||
adam = {'optim.optimizer': 'adamw', 'optim.lr': 1e-4} | ||
|
||
stereo = { | ||
'codebooks_pattern.delay.delays': [0, 0, 1, 1, 2, 2, 3, 3], | ||
'transformer_lm.n_q': 8, | ||
'interleave_stereo_codebooks.use': True, | ||
'channels': 2, | ||
} | ||
|
||
# You must follow the instructions in docs/MUSICGEN.md about the creation | ||
# of the proper fine tuning checkpoints. We will assume they are stored under | ||
# ~/checkpoints/{mode_name}. | ||
|
||
checkpoints = Path.home() / 'checkpoints' | ||
|
||
launcher.bind_(fsdp, stereo, {'optim.epochs': 100}) | ||
|
||
launcher.slurm_(gpus=32).bind_(label='32gpus') | ||
with launcher.job_array(): | ||
sub = launcher.bind({'continue_from': str(checkpoints / 'stereo_finetune_musicgen-small.th')}) | ||
sub() | ||
|
||
launcher.slurm_(gpus=64).bind_(label='64gpus') | ||
with launcher.job_array(): | ||
sub = launcher.bind({'continue_from': str(checkpoints / 'stereo_finetune_musicgen-medium.th')}) | ||
sub(medium, adam) | ||
|
||
launcher.slurm_(gpus=96).bind_(label='96gpus') | ||
with launcher.job_array(): | ||
sub = launcher.bind({'continue_from': str(checkpoints / 'stereo_finetune_musicgen-large.th')}) | ||
sub(large, cfg_low, wd_low, adam, {'optim.max_norm': 3}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.