Views
No views yet
OpenMuQ/MuQ-large-msd-iter (tuning mode: frozen)mse1import torch
2import torchaudio
3from omegaconf import OmegaConf
4from huggingface_hub import hf_hub_download
5
6# Download files
7config_path = hf_hub_download("zhudi2825/MuQ-Eval-A1", "config.yaml")
8model_path = hf_hub_download("zhudi2825/MuQ-Eval-A1", "best_model.pt")
9
10# Load config and build model
11cfg = OmegaConf.load(config_path)
12from src.model import MusicQualityModel
13model = MusicQualityModel(cfg)
14
15ckpt = torch.load(model_path, map_location="cpu", weights_only=False)
16model.load_state_dict(ckpt["model_state"])
17model.eval()
18
19# Run inference
20waveform, sr = torchaudio.load("audio.wav")
21if sr != 24000:
22 waveform = torchaudio.transforms.Resample(sr, 24000)(waveform)
23waveform = waveform.mean(0) # mono
24waveform = waveform[:240000].unsqueeze(0) # [1, samples]
25
26with torch.no_grad():
27 preds = model(waveform)
28 scores = model._last_expected_scores
29 for name, score in scores.items():
30 print(f"{name}: {score.item():.2f}")1@article{zhu2026muqeval,
2 title={Frozen Music Representations Suffice for Per-Sample Quality Prediction of Generated Music},
3 author={Zhu, Di and Li, Zixuan},
4 journal={arXiv preprint arXiv:2603.22677},
5 year={2026}
6}