MLX port of
Instruct-MusicGen
— text-instructed
music editing. Built on
MusicGen-large
(3.3B params, 48-layer autoregressive
transformer over EnCodec 32 kHz tokens) with cross-attention base weights from
the upstream checkpoint, LoRA-merged on Q/V (α/r = 2.0), plus a 48-layer
CPTransformer
adapter that injects the input audio's per-layer Q/K/V via
prefix-attention into every self-attention block.
Inputs / Outputs
Input
: text instruction (e.g.
"Music piece. Instruct: Only Drums."
) +
input audio (mono float32 @ 32 kHz, ≤ 10 s window)
Mean CLAP score (laion/clap-htsat-unfused) across 4 edit instructions on a
MusicGen-generated input clip — output vs the
instruction text
:
Variant
mean CLAP
"Only Drums"
"Only Piano"
"Remove Drums"
"Only Bass"
FP16
+0.352
+0.40
+0.36
+0.42
+0.22
INT4 (this bundle)
+0.311
+0.45
+0.17
+0.40
+0.21
INT8
+0.311
+0.44
+0.20
+0.39
+0.21
INT4 ≈ INT8 in CLAP, both within ~12 % of FP16. The "Only X" instructions
generally produce a positive Δ vs the input clip's CLAP score — i.e. the edit
moves the audio toward the instruction. "Only Bass" remains the hardest case.
Usage (sketch)
from huggingface_hub import snapshot_download
bundle = snapshot_download("aufklarer/Instruct-MusicGen-MLX-4bit")
# Production loader: https://github.com/soniqo/speech-swift# Minimal MLX sketch:# 1. Read bundle/config.json (HF MusicGen config + cp_transformer metadata)# 2. Construct InstructMusicGen MLX class# 3. Replay quantization on linear projections (mlx.nn.quantize, bits=4)# 4. Load weights from bundle/model.safetensors# 5. audio = model.generate(text, input_audio, max_steps=250)
CPTransformer
: shares the base LM's transformer blocks (norm/self-attn/FFN)
but adds learned
pos_emb
(49, 501, 2048),
merge_linear[i]
per layer
(2048 → 2048), and a zero-init
gate[i]
scalar.
Prefix injection
(per self-attn): second SDPA over the input audio's
K/V, with
dt_q = prefix_q[step] + main_q
, gated add before
out_proj
:
attn = main_attn + dt_attn × gate[i]
.
Instruct-MusicGen-MLX-4bit huggingface.co is an AI model on huggingface.co that provides Instruct-MusicGen-MLX-4bit's model effect (), which can be used instantly with this aufklarer Instruct-MusicGen-MLX-4bit model. huggingface.co supports a free trial of the Instruct-MusicGen-MLX-4bit model, and also provides paid use of the Instruct-MusicGen-MLX-4bit. Support call Instruct-MusicGen-MLX-4bit model through api, including Node.js, Python, http.
Instruct-MusicGen-MLX-4bit huggingface.co is an online trial and call api platform, which integrates Instruct-MusicGen-MLX-4bit's modeling effects, including api services, and provides a free online trial of Instruct-MusicGen-MLX-4bit, you can try Instruct-MusicGen-MLX-4bit online for free by clicking the link below.
aufklarer Instruct-MusicGen-MLX-4bit online free url in huggingface.co:
Instruct-MusicGen-MLX-4bit is an open source model from GitHub that offers a free installation service, and any user can find Instruct-MusicGen-MLX-4bit on GitHub to install. At the same time, huggingface.co provides the effect of Instruct-MusicGen-MLX-4bit install, users can directly use Instruct-MusicGen-MLX-4bit installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
Instruct-MusicGen-MLX-4bit install url in huggingface.co: