CoolFace
Apppublic

softwareweaver/MusicGen

sourceHugging Facecc-by-nc-4.0updated 11mo agoView on Hugging Face
0likes
DATASETS.md83 linesDownload Raw Back to docs
1# AudioCraft datasets2 3Our dataset manifest files consist in 1-json-per-line files, potentially gzipped,4as `data.jsons` or `data.jsons.gz` files. This JSON contains the path to the audio5file and associated metadata. The manifest files are then provided in the configuration,6as `datasource` sub-configuration. A datasource contains the pointers to the paths of7the manifest files for each AudioCraft stage (or split) along with additional information8(eg. maximum sample rate to use against this dataset). All the datasources are under the9`dset` group config, with a dedicated configuration file for each dataset.10 11## Getting started12 13### Example14 15See the provided example in the directory that provides a manifest to use the example dataset16provided under the [dataset folder](../dataset/example).17 18The manifest files are stored in the [egs folder](../egs/example).19 20```shell21egs/22  example/data.json.gz23```24 25A datasource is defined in the configuration folder, in the dset group config for this dataset26at [config/dset/audio/example](../config/dset/audio/example.yaml):27 28```shell29# @package __global__30 31datasource:32  max_sample_rate: 4410033  max_channels: 234 35  train: egs/example36  valid: egs/example37  evaluate: egs/example38  generate: egs/example39```40 41For proper dataset, one should create manifest for each of the splits and specify the correct path42to the given manifest in the datasource for each split.43 44Then, using a dataset through the configuration can be done pointing to the45corresponding dataset configuration:46```shell47dset=<dataset_name> # <dataset_name> should match the yaml file name48 49# for example50dset=audio/example51```52 53### Creating manifest files54 55Assuming you want to create manifest files to load with AudioCraft's AudioDataset, you can use56the following command to create new manifest files from a given folder containing audio files:57 58```shell59python -m audiocraft.data.audio_dataset <path_to_dataset_folder> egs/my_dataset/my_dataset_split/data.jsonl.gz60 61# For example to generate the manifest for dset=audio/example62# note: we don't use any split and we don't compress the jsonl file for this dummy example63python -m audiocraft.data.audio_dataset dataset/example egs/example/data.jsonl64 65# More info with: python -m audiocraft.data.audio_dataset --help66```67 68## Additional information69 70### MusicDataset and metadata71 72The MusicDataset is an AudioDataset with additional metadata. The MusicDataset expects73the additional metadata to be stored in a JSON file that has the same path as the corresponding74audio file, but with a `.json` extension.75 76### SoundDataset and metadata77 78The SoundDataset is an AudioDataset with descriptions metadata. Similarly to the MusicDataset,79the SoundDataset expects the additional metadata to be stored in a JSON file that has the same80path as the corresponding audio file, but with a `.json` extension. Additionally, the SoundDataset81supports an additional parameter pointing to an extra folder `external_metadata_source` containing82all the JSON metadata files given they have the same filename as the audio file.83