mlx-Yue2-3B

This repository provides pre-converted native MLX weights for YuE2-3B, an advanced music foundation model by M-A-P (Multimodal Art Projection).

Complete inference source code, CLI, and documentation are hosted on GitHub: ๐Ÿ‘‰ https://github.com/vanch007/mlx-Yue


Model Description

  • Architecture: Native Apple Silicon implementation of YuE2 autoregressive planning (AR), flow-matching acoustic diffusion (NAR), and high-fidelity 48kHz FP32 Oobleck VAE decoding.
  • Precision Variants Included:
    • ar-bf16.safetensors: Full-precision BF16 Autoregressive model (4.33 GB).
    • ar-8bit.safetensors: 8-bit quantized Autoregressive linear layers (2.66 GB), reducing memory footprint by ~39% while accelerating generation to ~83 tokens/s on M3 Max.
    • nar-bf16.safetensors: BF16 Non-Autoregressive acoustic flow-matching model (2.93 GB).
    • qwen.tiktoken & config files.

Quick Start with mlx-Yue

1. Install mlx-Yue

Follow the setup instructions in the GitHub Repository:

git clone https://github.com/vanch007/mlx-Yue.git
cd mlx-Yue
uv sync --frozen --no-dev --extra transcription
source .venv/bin/activate

2. Download Weights

Download these model weights using huggingface_hub:

python -c '
from huggingface_hub import snapshot_download
snapshot_download(repo_id="vanch007/mlx-Yue2-3B", local_dir="models/converted")
'

For VAE:

python -c '
from huggingface_hub import snapshot_download
snapshot_download(repo_id="m-a-p/YuE2-Vae", local_dir="models/vae")
'
export LYRA_VAE="$(pwd)/models/vae"

3. Generate Music

Generate a full song using the 8-bit model:

mlx-yue generate examples/full-song.json \
  --model models/converted \
  --vae "$LYRA_VAE" \
  --precision 8bit \
  --output outputs/my_song

Or via Python:

from lyra import YuE2Pipeline

pipe = YuE2Pipeline.from_pretrained(
    "models/converted",
    vae="models/vae",
    precision="8bit",
    local_files_only=True
)

result = pipe(
    style="80s synthpop, upbeat energetic drums, female vocal",
    lyrics="""[verse]
City lights neon glow
Running fast losing control
[chorus]
Dance with the stars through the electric night
We are the dreamers chasing the light
"""
)
result.save_artifacts("outputs/my_song")

Benchmarks (Apple M3 Max)

Precision AR File Size AR Generation Speed 32-Step Full NAR (170s audio)
BF16 4.33 GB ~59.4 tokens/s 186.94 s
8-Bit Quantized 2.66 GB ~83.1 tokens/s 186.94 s

Citation & Acknowledgments

Downloads last month
32
MLX
Hardware compatibility
Log In to add your hardware

8-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for vanch007/mlx-Yue2-3B

Base model

m-a-p/YuE2-3B
Finetuned
(2)
this model