Model reference · open weights
musicgen-small is an open-weight audio or speech model from facebook, listed in the AxForge catalogue. AxForge can bring it up on EU-owned hardware for you on request — with the licence handled where one is required.
About
MusicGen - Small - 300M MusicGen is a text-to-music model capable of genreating high-quality music samples conditioned on text descriptions or audio prompts. It is a single stage auto-regressive Transformer model trained over a 32kHz EnCodec tokenizer with 4 codebooks sampled at 50 Hz. Unlike existing methods, like MusicLM, MusicGen doesn't require a self-supervised semantic representation, and it generates all 4 codebooks in one pass. By introducing a small delay between the codebooks, we show we can predict them in parallel, thus having only 50 auto-regressive steps per second of audio. MusicGen was published in Simple and Controllable Music Generation by Jade Copet, Felix Kreuk, Itai Gat, Tal Remez, David Kant, Gabriel Synnaeve, Yossi Adi, Alexandre Défossez. Four checkpoints are released: - small (this checkpoint) - medium - large - melody Example Try out MusicGen yourself! Audiocraft Colab: Hugging Face Colab: Hugging Face Demo: 🤗 Transformers Usage You can run MusicGen locally with the 🤗 Transformers library from version 4.31.0 onwards. 1. First install the 🤗 Transformers library and scipy: 2. Run inference via the Text-to-Audio (TTA) pipeline. You can infer the MusicGen model via the TTA pipeline in just a few lines of code! 3. Run inference via the Transformers modelling code. You can use the processor + generate code to convert text into a mono 32 kHz audio waveform for more fine-grained control. 3. Listen to the audio samples either in an ipynb notebook: Or save them as a .wav file using a third-party library, e.g. scipy: For more details on using the MusicGen model for inference using the 🤗 Transformers library, refer to the MusicGen docs. Audiocraft Usage You can also run MusicGen locally through the original Audiocraft library: 1. First install the audiocraft library 2. Make sure to have ffmpeg installed: 3. Run the following Python code: Model details Organization developing the model: The FAIR team of Meta AI. Model date: MusicGen was trained between April 2023 and May 2023. Model version: This is the version 1 of the model. Model type: MusicGen consists of an EnCodec model for audio tokenization, an auto-regressive language model based on the tra
Summarised from the published model card. Read the full card on the HuggingFace links below.
Specifications
| Maker | |
|---|---|
| Type | Audio & music |
| Parameters (lead) | 591M |
| Variants | 1 |
| Runs with | transformers |
| Released | 2023-06-08 |
| Popularity | 203k downloads / month |
| Likes | 509 |
| Licence | Commercial licence needed |
How it works
Variants
Open weights ship in several sizes and precisions. One page, all the variants — pick the one that fits your GPU. VRAM figures are estimates from model size.
| Variant | Params | Precision | VRAM | Fits 16 GB | Weights |
|---|---|---|---|---|---|
| musicgen-small | 591M | BF16 | ~1.4 GB | ✓ | Weights ↗ |
Using it via the API
Once AxForge deploys musicgen-small for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (musicgen-small below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/audio/transcriptions \ -H "Authorization: Bearer $AXFORGE_API_KEY" \ -F model="musicgen-small" -F file=@audio.mp3
Licence
The weights are open but cc-by-nc-4.0 needs a commercial agreement for business use. AxForge can arrange that licence and host the model for you — you pay AxForge, we settle with the model’s maker. Ask us for a quote. Read the licence ↗