Model reference · open weights
SheetSage2 is an open-weight embedding model from m-a-p. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | m-a-p |
|---|---|
| Type | Embedding models |
| Task | Embeddings |
| Parameters (lead) | 57M |
| Runs with | transformers |
| Based on | m-a-p/MERT-v2-FullSong |
| Released | 2026-09-09 |
| Popularity | 2k downloads / month |
| Licence | Commercial licence needed |
About
· · ·
SheetSage2 turns music recordings into lead sheets and timed musical annotations. Transcribe a complete song, edit its ABC or MIDI, render a piano preview, or extract embeddings and token predictions for your own tools.
Built on MERT-v2-FullSong, with adapters that merge automatically when you load the model.
Use Python 3.10 or 3.11 and FFmpeg 6.1 with its shared libraries. Sign in with access to this repository and its MERT-v2 parent:
python -m pip install huggingface-hub==0.36.0
huggingface-cli download m-a-p/SheetSage2 --local-dir SheetSage2
cd SheetSage2
python -m pip install torch==2.8.0 torchaudio==2.8.0 --index-url https://download.pytorch.org/whl/cu126
python -m pip install -r requirements.txt
import torch
from transformers import AutoModel
model = AutoModel.from_pretrained(
"m-a-p/SheetSage2", trust_remote_code=True,
).eval().to("cuda" if torch.cuda.is_available() else "cpu")
result = model.transcribe("song.mp3", output_dir="output")
Files are decoded, mixed to mono and resampled automatically. Long songs use overlapping windows.
| Output | File |
|---|---|
| Editable score | score.abc |
| Melody and chord accompaniment | transcription.mid |
| Separate melodies and chords | melody_vocal.mid, melody_instrumental.mid, chords.mid |
| Timed annotations | events.json, *.lab |
Omit output_dir to keep results in memory. Pass a Tensor or NumPy waveform with its sample rate:
# waveform: [samples] or [channels, samples]
result = model.transcribe(waveform, sampling_rate=24000)
abc = result["abc"] # str
midi = result["midi"] # bytes
events = result["events"] # list of timed events
Paths, encoded audio bytes and binary streams are also accepted. result["midis"] contains the separate MIDI parts; result["labs"] contains annotation text. Request export_logits=True, export_scores=True or export_embeddings=True for CPU tensors in result["tensors"], grouped by window; add output_hidden_states=True for all 24 MERT layers. With output_dir, these tensors are saved as safetensors instead. Low-level forward() returns logits and optional hidden states; generate() returns symbolic tokens.
Save a self-contained model for offline use:
model.save_pretrained("sheetsage2-local")
model = AutoModel.from_pretrained(
"sheetsage2-local", trust_remote_code=True, local_files_only=True,
)
Set melody_only=True to retain both the Vocal and Ins melodies while omitting chord symbols from the ABC and chord accompaniment from playback/combined MIDI. Raw predicted annotations remain available; the default full transcription is unchanged.
result = model.transcribe("song.mp3", output_dir="cover-score", melody_only=True)
abc = result["abc"] # Also saved as cover-score/score.abc.
python infer.py song.mp3 --output cover-score --melody-only
Review the transcription, then pass result["abc"] or the saved cover-score/score.abc to YuE2 as abc, with cot="melody" and your target style and lyrics. If the requested ABC cannot be produced, Python raises an error (partial results are available as error.result) and the CLI exits with a nonzero status.
python infer.py song.mp3 --output output
# Optional piano audio and printable sheet music:
python setup_render.py
python infer.py song.mp3 --output output --render-audio --render-score
# Render existing results without loading the model:
python render.py --input output --output rendered --audio --score pdf,svg,png
On minimal Linux servers, use python setup_render.py --with-deps. Audio follows the original MIDI timing. Scores preserve the vocal and instrumental staves. For separate piano previews, use --render-parts vocal,instrumental,chords with infer.py, or --parts vocal,instrumental,chords with render.py.
Python also accepts render_audio=True, render_score="pdf,svg,png". In memory mode, result["rendered"] contains audio (part → WAV bytes) and score (format → pages as PDF/PNG bytes or SVG text).
Scores (%) on H800 with BF16 inference; higher is better. Use preset="paper" or --preset paper with the dataset prompts in scores and settings.
| Task | Dataset | Metric | SheetSage1 | madmom | Specialist | SheetSage2 |
|---|---|---|---|---|---|---|
| Beat | GTZAN | F1 | 85.79 | 85.79 | 88.75 Beat This! | 85.65 |
| Beat | osu2017 | F1 | 91.55 | 91.55 | 88.18 Beat This! | 92.29 |
| Downbeat | GTZAN | F1 | 64.33 | 64.33 | 78.28 Beat This! | 79.51 |
| Downbeat | osu2017 | F1 | 83.22 | 83.22 | 84.99 Beat This! | 91.97 |
| Key | GiantSteps | Weighted | 43.89 | 74.62 | 72.09 [S-KEY][key] | 77.73 |
| Key | GTZAN | Weighted | 54.56 | 72.05 | 74.43 [S-KEY][key] | 75.77 |
| Chord | osu2017 | Maj/min | 79.82 | 77.42 | 84.59 [Jiang et al.][chord] | 90.08 |
| Chord | Chords1217 | Maj/min | 72.98 | 83.52* | 84.09† [ChordFormer][chordformer] | 83.81 |
| Structure | HarmonixSet | Accuracy | — | — | 80.03 [SongFormer][structure] | 80.51 |
| Structure | HarmonixSet | F1 @ 0.5 s | — | — | 70.63 [SongFormer][structure] | 67.96 |
| Structure | HarmonixSet | F1 @ 3 s | — | — | 79.50 [SongFormer][structure] | 82.86 |
| Melody | RWC-Pop | Vocal F1 | 62.71 | — | 62.71 [SheetSage1][sheetsage] | 82.51 |
| Melody | RWC-Pop | Full F1 | 64.02 | — | 64.02 [SheetSage1][sheetsage] | 75.29 |
Melody F1 uses pitch classes. SheetSage1 beat/downbeat results use madmom. *The madmom chord model includes Chords1217 in training. †ChordFormer uses five-fold cross-validation; SheetSage2 uses one checkpoint across all tracks.
From the published model card. Full card on the HuggingFace links in the sidebar.
Using it via the API
Once AxForge deploys sheetsage2 for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (sheetsage2 below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/embeddings \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"sheetsage2","input":"text to embed"}'
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.