Instructions to use mlx-community/SongGeneration-v2-large-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/SongGeneration-v2-large-8bit with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] huggingface-cli download --local-dir SongGeneration-v2-large-8bit mlx-community/SongGeneration-v2-large-8bit
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- LM Studio
Update SongGeneration MLX usage instructions
Browse files
README.md
CHANGED
|
@@ -34,14 +34,15 @@ This is not a full-stack pure MLX audio pipeline yet: token generation runs with
|
|
| 34 |
## Quick Start
|
| 35 |
|
| 36 |
```bash
|
| 37 |
-
hf download mlx-community/SongGeneration-v2-large-8bit --local-dir ./models/SongGeneration-v2-large-8bit
|
| 38 |
-
|
| 39 |
git clone https://github.com/ailuntx/SongGeneration-MLX.git
|
| 40 |
cd SongGeneration-MLX
|
| 41 |
python -m venv .venv
|
| 42 |
.venv/bin/pip install -e .
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
-
|
| 45 |
--model ./models/SongGeneration-v2-large-8bit \
|
| 46 |
--lyrics '[verse] hello from mlx [chorus] sing it again' \
|
| 47 |
--description 'Pop, female vocal, bright production, [Musicality-medium].' \
|
|
@@ -51,7 +52,29 @@ PYTHONPATH=. .venv/bin/python -m songgeneration_mlx.cli \
|
|
| 51 |
--output tokens_2s.npz
|
| 52 |
```
|
| 53 |
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
|
| 56 |
## Variants
|
| 57 |
|
|
@@ -65,6 +88,7 @@ To decode tokens to FLAC, use the official decoder bridge documented in the GitH
|
|
| 65 |
| `SongGeneration-v2-large-bfloat16` | 9.5G | large quality baseline |
|
| 66 |
| `SongGeneration-v2-large-8bit` | 5.0G | smaller large checkpoint |
|
| 67 |
| `SongGeneration-v2-large-4bit` | 2.7G | smallest large checkpoint |
|
|
|
|
| 68 |
|
| 69 |
## Layout
|
| 70 |
|
|
|
|
| 34 |
## Quick Start
|
| 35 |
|
| 36 |
```bash
|
|
|
|
|
|
|
| 37 |
git clone https://github.com/ailuntx/SongGeneration-MLX.git
|
| 38 |
cd SongGeneration-MLX
|
| 39 |
python -m venv .venv
|
| 40 |
.venv/bin/pip install -e .
|
| 41 |
+
.venv/bin/pip install -U huggingface_hub hf_transfer
|
| 42 |
+
|
| 43 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 .venv/bin/hf download mlx-community/SongGeneration-v2-large-8bit --local-dir ./models/SongGeneration-v2-large-8bit
|
| 44 |
|
| 45 |
+
.venv/bin/python -m songgeneration_mlx.cli \
|
| 46 |
--model ./models/SongGeneration-v2-large-8bit \
|
| 47 |
--lyrics '[verse] hello from mlx [chorus] sing it again' \
|
| 48 |
--description 'Pop, female vocal, bright production, [Musicality-medium].' \
|
|
|
|
| 52 |
--output tokens_2s.npz
|
| 53 |
```
|
| 54 |
|
| 55 |
+
## Decode Tokens
|
| 56 |
+
|
| 57 |
+
The MLX runtime writes discrete song tokens. To create FLAC audio, use the official decoder bridge in [`ailuntx/SongGeneration-MLX`](https://github.com/ailuntx/SongGeneration-MLX). The bridge needs the official SongGeneration `runtime/` assets, but it does not need the original SongGeneration LM `model.pt` when `--mlx-model` is used.
|
| 58 |
+
|
| 59 |
+
```bash
|
| 60 |
+
python -m venv .venv-decoder
|
| 61 |
+
.venv-decoder/bin/pip install -U pip
|
| 62 |
+
.venv-decoder/bin/pip install \
|
| 63 |
+
-r third_party/SongGeneration/requirements.txt \
|
| 64 |
+
-r third_party/SongGeneration/requirements_nodeps.txt \
|
| 65 |
+
soundfile
|
| 66 |
+
|
| 67 |
+
HF_HUB_ENABLE_HF_TRANSFER=1 .venv/bin/hf download tencent/SongGeneration \
|
| 68 |
+
--include "runtime/*" \
|
| 69 |
+
--local-dir ./third_party/SongGeneration
|
| 70 |
+
|
| 71 |
+
PYTORCH_ENABLE_MPS_FALLBACK=1 SONGGEN_DEVICE=mps \
|
| 72 |
+
.venv-decoder/bin/python scripts/decode_tokens_official.py \
|
| 73 |
+
--mlx-model ./models/SongGeneration-v2-large-8bit \
|
| 74 |
+
--tokens ./tokens_2s.npz \
|
| 75 |
+
--output ./output_2s.flac \
|
| 76 |
+
--device mps
|
| 77 |
+
```
|
| 78 |
|
| 79 |
## Variants
|
| 80 |
|
|
|
|
| 88 |
| `SongGeneration-v2-large-bfloat16` | 9.5G | large quality baseline |
|
| 89 |
| `SongGeneration-v2-large-8bit` | 5.0G | smaller large checkpoint |
|
| 90 |
| `SongGeneration-v2-large-4bit` | 2.7G | smallest large checkpoint |
|
| 91 |
+
| `SongGeneration-v2-fast-*` | pending | upstream fast weights were not publicly available when checked on 2026-05-31 |
|
| 92 |
|
| 93 |
## Layout
|
| 94 |
|