From 181f85da24f4cf5b0ce466e0be7fbe276a790edc Mon Sep 17 00:00:00 2001 From: yoinked Date: Fri, 24 Nov 2023 03:34:24 -0800 Subject: [PATCH] Docs/Add conversion code to the musicgen docs (#27665) * Update musicgen.md please make it less hidden * Add cleaner formatting --- docs/source/en/model_doc/musicgen.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/source/en/model_doc/musicgen.md b/docs/source/en/model_doc/musicgen.md index d9e8429485..bc2234ce3c 100644 --- a/docs/source/en/model_doc/musicgen.md +++ b/docs/source/en/model_doc/musicgen.md @@ -46,6 +46,16 @@ This model was contributed by [sanchit-gandhi](https://huggingface.co/sanchit-ga [here](https://github.com/facebookresearch/audiocraft). The pre-trained checkpoints can be found on the [Hugging Face Hub](https://huggingface.co/models?sort=downloads&search=facebook%2Fmusicgen-). +## Usage tips + +- After downloading the original checkpoints from [here](https://github.com/facebookresearch/audiocraft/blob/main/docs/MUSICGEN.md#importing--exporting-models) , you can convert them using the **conversion script** available at +`src/transformers/models/musicgen/convert_musicgen_transformers.py` with the following command: + +```bash +python src/transformers/models/musicgen/convert_musicgen_transformers.py \ + --checkpoint small --pytorch_dump_folder /output/path --safe_serialization +``` + ## Generation MusicGen is compatible with two generation modes: greedy and sampling. In practice, sampling leads to significantly