MERT-v2-FullSong is a bidirectional music encoder adapted to complete songs lasting 30–360 seconds.
Extract general-purpose music representations at the frame or recording level. Load with standard Hugging Face Transformers, using the familiar
MERT
workflow.
It continues pretraining from
MERT-v2-30s
and preserves the same feature interface.
MERT-v2-30s uses the bidirectional backbone in (B); MERT-v2-FullSong continues through the full-song branch in (C). The causal branch is used for YuE2 tokenization.
import soundfile as sf
import torch
import torchaudio.functional as AF
from transformers import AutoFeatureExtractor, AutoModel
repo = "m-a-p/MERT-v2-FullSong"
device = "cuda"if torch.cuda.is_available() else"cpu"
processor = AutoFeatureExtractor.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True).eval().to(device)
audio, sr = sf.read("music.wav", dtype="float32", always_2d=True)
audio = audio[:30 * sr].mean(axis=1) # First 30 seconds, mixed to mono.
waveform = AF.resample(torch.from_numpy(audio), sr, processor.sampling_rate)
inputs = processor(
waveform.numpy(), sampling_rate=processor.sampling_rate, return_tensors="pt",
).to(device)
with torch.inference_mode():
output = model(**inputs, output_hidden_states=True)
frames = output.last_hidden_state # [batch, frames, 1024], 25 Hz
layers = output.hidden_states # 24 tensors, one per block
mask = output.feature_attention_mask[..., None]
embedding = (frames * mask).sum(1) / mask.sum(1).clamp_min(1) # [batch, 1024]
hidden_states[0]
is block 1;
hidden_states[23]
is block 24. Remove the audio slice to process a complete song.
📊 MARBLE
Reported frozen-encoder results on
MARBLE
. All scores are multiplied by 100; higher is better.
Bold
marks the best displayed value in each column, including ties.
Baseline scores and parameter counts are reproduced from Tables III and V of
PupuJEPA
; the baselines were not rerun for this release. Evaluation protocols may differ across sources.
General music understanding.
MTT = MagnaTagATune; key = GiantSteps refined key accuracy; genre and beat = GTZAN; valence and arousal = EmoMusic. ROC = ROC-AUC; AP = average precision.
@inproceedings{li2024mert,
title = {MERT: Acoustic Music Understanding Model with Large-Scale Self-supervised Training},
author = {Li, Yizhi and Yuan, Ruibin and Zhang, Ge and Ma, Yinghao and Chen, Xingran and Yin, Hanzhi and Xiao, Chenghao and Lin, Chenghua and Ragni, Anton and Benetos, Emmanouil and Gyenge, Norbert and Dannenberg, Roger and Liu, Ruibo and Chen, Wenhu and Xia, Gus and Shi, Yemin and Huang, Wenhao and Wang, Zili and Guo, Yike and Fu, Jie},
booktitle = {International Conference on Learning Representations},
year = {2024},
url = {https://proceedings.iclr.cc/paper_files/paper/2024/hash/33dffa2e3d2ab74a783d1a8c292f66d9-Abstract-Conference.html}
}
@inproceedings{yuan2023marble,
title = {MARBLE: Music Audio Representation Benchmark for Universal Evaluation},
author = {Yuan, Ruibin and Ma, Yinghao and Li, Yizhi and Zhang, Ge and Chen, Xingran and Yin, Hanzhi and Zhuo, Le and Liu, Yiqi and Huang, Jiawen and Tian, Zeyue and Deng, Binyue and Wang, Ningzhi and Lin, Chenghua and Benetos, Emmanouil and Ragni, Anton and Gyenge, Norbert and Dannenberg, Roger and Chen, Wenhu and Xia, Gus and Xue, Wei and Liu, Si and Wang, Shi and Liu, Ruibo and Guo, Yike and Fu, Jie},
booktitle = {Advances in Neural Information Processing Systems},
volume = {36},
pages = {39626--39647},
year = {2023},
doi = {10.52202/075280-1722},
url = {https://proceedings.neurips.cc/paper_files/paper/2023/hash/7cbeec46f979618beafb4f46d8f39f36-Abstract-Datasets_and_Benchmarks.html}
}
MERT-v2-FullSong huggingface.co is an AI model on huggingface.co that provides MERT-v2-FullSong's model effect (), which can be used instantly with this m-a-p MERT-v2-FullSong model. huggingface.co supports a free trial of the MERT-v2-FullSong model, and also provides paid use of the MERT-v2-FullSong. Support call MERT-v2-FullSong model through api, including Node.js, Python, http.
MERT-v2-FullSong huggingface.co is an online trial and call api platform, which integrates MERT-v2-FullSong's modeling effects, including api services, and provides a free online trial of MERT-v2-FullSong, you can try MERT-v2-FullSong online for free by clicking the link below.
m-a-p MERT-v2-FullSong online free url in huggingface.co:
MERT-v2-FullSong is an open source model from GitHub that offers a free installation service, and any user can find MERT-v2-FullSong on GitHub to install. At the same time, huggingface.co provides the effect of MERT-v2-FullSong install, users can directly use MERT-v2-FullSong installed effect in huggingface.co for debugging and trial. It also supports api for free installation.