Model reference · open weights

MERT-public

Embeddings m-a-p Embeddings 1 build Non-commercial 851 dl/mo

MERT-public is an open-weight embedding model from m-a-p. MERT-v0-public (BF16) weighs 378 MB; the smallest configuration that runs it is RTX 3060 12 GB.

For self-hosting, compare this build's requirements below with the GPU you plan to rent.

  • MERT-v0-public is a 95M parameter feature-extraction model developed by m-a-p for music audio representation learning.
  • It was trained on 900 hours of open-source music data from the Music4All and FMA_full datasets.
  • The model processes audio at a 16K Hz sample rate with a 5-second pre-training context and outputs features at a rate of 50 Hz.
  • It is distributed under the cc-by-nc-4.0 license.

Summary of the m-a-p/MERT-v0-public model card, 2026-10-01

What it is

Released bym-a-p
Released2023-03-14
VRAM378 MB for the weights

What it runs on

Memory and cards for MERT-v0-public (BF16)

378 MBweights, file size
1.1 GBruntime overhead
CardRunsMemory
RTX 3060 12 GBfits11.6 GB
RTX 4060 Ti 16 GBfits15.4 GB
RTX 3090 24 GBfits23.4 GB
RTX 4090 24 GBfits23.4 GB
RTX 5090 32 GBfits31.0 GB
L40S 48 GBfits44.0 GB
A100 80 GBfits78.2 GB
H100 80 GBfits78.1 GB
RTX PRO 6000 Blackwell 96 GBfits93.8 GB
DGX Spark (GB10) 128 GB unifiedfits107 GB
H200 141 GBfits138 GB
B200 180 GBfits176 GB

From the model card

What m-a-p says about MERT-public

Read the model card

The development log of our Music Audio Pre-training (m-a-p) model family:

  • 02/06/2023: arxiv pre-print and training codes released.
  • 17/03/2023: we release two advanced music understanding models, MERT-v1-95M and MERT-v1-330M , trained with new paradigm and dataset. They outperform the previous models and can better generalize to more tasks.
  • 14/03/2023: we retrained the MERT-v0 model with open-source-only music dataset MERT-v0-public
  • 29/12/2022: a music understanding model MERT-v0 trained with MLM paradigm, which performs better at downstream tasks.
  • 29/10/2022: a pre-trained MIR model music2vec trained with BYOL paradigm.

Here is a table for quick model pick-up:

NamePre-train ParadigmTraining Data (hour)Pre-train Context (second)Model SizeTransformer Layer-DimensionFeature RateSample RateRelease Date
MERT-v1-330MMLM160K5330M24-102475 Hz24K Hz17/03/2023
MERT-v1-95MMLM20K595M12-76875 Hz24K Hz17/03/2023
MERT-v0-publicMLM900595M12-76850 Hz16K Hz14/03/2023
MERT-v0MLM1000595 M12-76850 Hz16K Hz29/12/2022
music2vec-v1BYOL10003095 M12-76850 Hz16K Hz30/10/2022

Explanation

The m-a-p models share the similar model architecture and the most distinguished difference is the paradigm in used pre-training. Other than that, there are several nuance technical configuration needs to know before using:

  • Model Size: the number of parameters that would be loaded to memory. Please select the appropriate size fitting your hardware.
  • Transformer Layer-Dimension: The number of transformer layers and the corresponding feature dimensions can be outputted from our model. This is marked out because features extracted by different layers could have various performance depending on tasks.
  • Feature Rate: Given a 1-second audio input, the number of features output by the model.
  • Sample Rate: The frequency of audio that the model is trained with.

Introduction to MERT-v0-public

MERT-v0-public is a completely unsupervised model trained on completely non-comercial open-source Music4All dataset and the part of FMA_full dataset that does not include tag "experimental".

The training settings and model usage of MERT-v0-public can be referred to the MERT-v0 model.

Details are reported at the short article Large-Scale Pretrained Model for Self-Supervised Music Audio Representation Learning.

Demo code

from transformers import Wav2Vec2FeatureExtractor
from transformers import AutoModel
import torch
from torch import nn
import torchaudio.transforms as T
from datasets import load_dataset

# loading our model weights
model = AutoModel.from_pretrained("m-a-p/MERT-v0-public", trust_remote_code=True)
# loading the corresponding preprocessor config
processor = Wav2Vec2FeatureExtractor.from_pretrained("m-a-p/MERT-v0-public",trust_remote_code=True)

# load demo audio and set processor
dataset = load_dataset("hf-internal-testing/librispeech_asr_demo", "clean", split="validation")
dataset = dataset.sort("id")
sampling_rate = dataset.features["audio"].sampling_rate

resample_rate = processor.sampling_rate
# make sure the sample_rate aligned
if resample_rate != sampling_rate:
    print(f'setting rate from {sampling_rate} to {resample_rate}')
    resampler = T.Resample(sampling_rate, resample_rate)
else:
    resampler = None

# audio file is decoded on the fly
if resampler is None:
    input_audio = dataset[0]["audio"]["array"]
else:
  input_audio = resampler(torch.from_numpy(dataset[0]["audio"]["array"]))

inputs = processor(input_audio, sampling_rate=resample_rate, return_tensors="pt")
with torch.no_grad():
    outputs = model(**inputs, output_hidden_states=True)

# take a look at the output shape, there are 13 layers of representation
# each layer performs differently in different downstream tasks, you should choose empirically
all_layer_hidden_states = torch.stack(outputs.hidden_states).squeeze()
print(all_layer_hidden_states.shape) # [13 layer, Time steps, 768 feature_dim]

# for utterance level classification tasks, you can simply reduce the representation in time
time_reduced_hidden_states = all_layer_hidden_states.mean(-2)
print(time_reduced_hidden_states.shape) # [13, 768]

# you can even use a learnable weighted average representation
aggregator = nn.Conv1d(in_channels=13, out_channels=1, kernel_size=1)
weighted_avg_hidden_states = aggregator(time_reduced_hidden_states.unsqueeze(0))

Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.

© 2026 AxForge · EU-hosted AI infrastructure Pricing Docs Trust Privacy Terms