Add model: BEATs pretrained audio models#4352
Conversation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
KennethEnevoldsen
left a comment
There was a problem hiding this comment.
I would really love to get this on HF, even if it is not supported that way everything we have is on HF.
| """ | ||
|
|
||
|
|
||
| def _load_beats_modules(): |
There was a problem hiding this comment.
Hmm don't we want to put it on huggingface instead?
There was a problem hiding this comment.
I think something like this could work:
from huggingface_hub import hf_hub_download
import torch
with open(hf_hub_download("username/repo", "model.pt"), "rb") as f:
obj = torch.load(f, map_location="cpu", weights_only=True)
| logger = logging.getLogger(__name__) | ||
|
|
||
| _BEATS_SRC_URL = "https://raw.githubusercontent.com/microsoft/unilm/master/beats" | ||
| _BEATS_SRC_FILES = ["BEATs.py", "backbone.py", "modules.py"] |
There was a problem hiding this comment.
I would probably rather copy this in - (this could break very easily with change on their end)
Either than or put it together with the weight on hf
|
So we didn't upload models like EvaCLIP to HF for the same reason - we don't maintain them. Could that be a caveat? That we can upload models but don't maintain them? Or we want to maintain them as well? |
|
|
||
| beats_iter1 = ModelMeta( | ||
| loader=BEATsWrapper, | ||
| name="microsoft/beats-iter1", |
There was a problem hiding this comment.
I added the "Pre-trained Model" column
There was a problem hiding this comment.
Are they then fine-utned on audioset?
Should we make sure they are eq. to the ones in the paper?
Should we rename to:
microsoft/beats-iter1-pretrained
There was a problem hiding this comment.
Are they then fine-utned on audioset?
Yeah, I've added it as a training dataset in ModelMeta.
Should we make sure they are eq. to the ones in the paper?
we get the same scores as in the paper for AudioSetMini, but different for ESC50, maybe because we set it up differently? (cross validation)
There was a problem hiding this comment.
Renamed models.
There was a problem hiding this comment.
Hmm out classification tasks are different due sampling - do we have some of the other models in their table we can compare with to see if the ordering is approx. the same?
There was a problem hiding this comment.
There's SpeechCommandsv2 too - we have the mini version.
There was a problem hiding this comment.
Hmm looked to compare a few of the implementation I'm not sure exactly what to draw from these, but beats seems to be doing surprisingly poorly.
| mdl | ours | theirs |
|---|---|---|
| beats | 0.75 | 0.951 |
| microsoft/msclap-2023 | 0.974 | |
| microsoft/msclap-2022 | 0.9095 | |
| CLAP (not sure which one) | 0.967 | |
| MIT/ast-finetuned-audioset-10-10-0.4593 / AST | 0.962 | 0.887 |
| lyrebird/wav2clip / Wav2CLIP | 0.721 | 0.860 |
We do seem to be maintaining relative ordering if CLAP == microsoft/msclap-2023.
There was a problem hiding this comment.
Which dataset/task are these for?
|
This pull request has been automatically marked as stale due to inactivity. |
|
@isaac-chung do we need to figure out what to do here? |
|
Re: model hosting, I guess we could a) copy the needed files, or b) host it in the mteb org on HF. Re: correctness/repro scores from the paper, we have the mini/sampled versions of the datasets they used in the paper. We can see if their repo has more scores. Otherwise I'm not sure what else we can try. |
|
If we could move it all to a versioned repo, then I think that would be fine (e.g. hf) |
|
@isaac-chung this seems to have been getting stale - do we want to finish it up? |
|
Sure. But we might want to focus on the mveb effort first? |
|
This pull request has been automatically marked as stale due to inactivity. |
|
This pull request has been automatically closed due to inactivity. |

Summary
Model checklist
mteb.get_model(model_name, revision)mteb.get_model_meta(model_name, revision)Notes
model_namemust point to a local.ptfile~/.cache/torch/hub/beats_src/