a43992899 commited on
Commit
e5818d4
·
0 Parent(s):

Release WildSongBench

Browse files
.gitattributes ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ *.7z filter=lfs diff=lfs merge=lfs -text
2
+ *.arrow filter=lfs diff=lfs merge=lfs -text
3
+ *.avro filter=lfs diff=lfs merge=lfs -text
4
+ *.bin filter=lfs diff=lfs merge=lfs -text
5
+ *.bz2 filter=lfs diff=lfs merge=lfs -text
6
+ *.ckpt filter=lfs diff=lfs merge=lfs -text
7
+ *.ftz filter=lfs diff=lfs merge=lfs -text
8
+ *.gz filter=lfs diff=lfs merge=lfs -text
9
+ *.h5 filter=lfs diff=lfs merge=lfs -text
10
+ *.joblib filter=lfs diff=lfs merge=lfs -text
11
+ *.lfs.* filter=lfs diff=lfs merge=lfs -text
12
+ *.lz4 filter=lfs diff=lfs merge=lfs -text
13
+ *.mds filter=lfs diff=lfs merge=lfs -text
14
+ *.mlmodel filter=lfs diff=lfs merge=lfs -text
15
+ *.model filter=lfs diff=lfs merge=lfs -text
16
+ *.msgpack filter=lfs diff=lfs merge=lfs -text
17
+ *.npy filter=lfs diff=lfs merge=lfs -text
18
+ *.npz filter=lfs diff=lfs merge=lfs -text
19
+ *.onnx filter=lfs diff=lfs merge=lfs -text
20
+ *.ot filter=lfs diff=lfs merge=lfs -text
21
+ *.parquet filter=lfs diff=lfs merge=lfs -text
22
+ *.pb filter=lfs diff=lfs merge=lfs -text
23
+ *.pickle filter=lfs diff=lfs merge=lfs -text
24
+ *.pkl filter=lfs diff=lfs merge=lfs -text
25
+ *.pt filter=lfs diff=lfs merge=lfs -text
26
+ *.pth filter=lfs diff=lfs merge=lfs -text
27
+ *.rar filter=lfs diff=lfs merge=lfs -text
28
+ *.safetensors filter=lfs diff=lfs merge=lfs -text
29
+ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
30
+ *.tar.* filter=lfs diff=lfs merge=lfs -text
31
+ *.tar filter=lfs diff=lfs merge=lfs -text
32
+ *.tflite filter=lfs diff=lfs merge=lfs -text
33
+ *.tgz filter=lfs diff=lfs merge=lfs -text
34
+ *.wasm filter=lfs diff=lfs merge=lfs -text
35
+ *.xz filter=lfs diff=lfs merge=lfs -text
36
+ *.zip filter=lfs diff=lfs merge=lfs -text
37
+ *.zst filter=lfs diff=lfs merge=lfs -text
38
+ *tfevents* filter=lfs diff=lfs merge=lfs -text
39
+ # Audio files - uncompressed
40
+ *.pcm filter=lfs diff=lfs merge=lfs -text
41
+ *.sam filter=lfs diff=lfs merge=lfs -text
42
+ *.raw filter=lfs diff=lfs merge=lfs -text
43
+ # Audio files - compressed
44
+ *.aac filter=lfs diff=lfs merge=lfs -text
45
+ *.flac filter=lfs diff=lfs merge=lfs -text
46
+ *.mp3 filter=lfs diff=lfs merge=lfs -text
47
+ *.ogg filter=lfs diff=lfs merge=lfs -text
48
+ *.wav filter=lfs diff=lfs merge=lfs -text
49
+ # Image files - uncompressed
50
+ *.bmp filter=lfs diff=lfs merge=lfs -text
51
+ *.gif filter=lfs diff=lfs merge=lfs -text
52
+ *.png filter=lfs diff=lfs merge=lfs -text
53
+ *.tiff filter=lfs diff=lfs merge=lfs -text
54
+ # Image files - compressed
55
+ *.jpg filter=lfs diff=lfs merge=lfs -text
56
+ *.jpeg filter=lfs diff=lfs merge=lfs -text
57
+ *.webp filter=lfs diff=lfs merge=lfs -text
58
+ # Video files - compressed
59
+ *.mp4 filter=lfs diff=lfs merge=lfs -text
60
+ *.webm filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,141 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: WildSongBench
3
+ language:
4
+ - zh
5
+ - en
6
+ size_categories:
7
+ - n<1K
8
+ tags:
9
+ - music-generation
10
+ - benchmark
11
+ configs:
12
+ - config_name: default
13
+ data_files:
14
+ - split: test
15
+ path: prompts.jsonl
16
+ ---
17
+
18
+ <h1 align="center">🤗 WildSongBench</h1>
19
+ <p align="center"><strong>A benchmark for full-song music generation</strong></p>
20
+ <p align="center">192 prompts · 94 Chinese · 98 English</p>
21
+
22
+ <p align="center">
23
+ <a href="https://map-yue2.github.io/">🎵&nbsp;YuE2&nbsp;project</a>
24
+ ·
25
+ <a href="#quick-start">🚀&nbsp;Quick&nbsp;start</a>
26
+ ·
27
+ <a href="#benchmarks">📊&nbsp;Benchmarks</a>
28
+ ·
29
+ <a href="#reproduce-standard-yue2">🔁&nbsp;Reproduce</a>
30
+ ·
31
+ <a href="#citation">📚&nbsp;Citation</a>
32
+ </p>
33
+ <p align="center">
34
+ <a href="https://huggingface.co/m-a-p/YuE2-3B"><img alt="🤗 YuE2-3B" src="https://img.shields.io/badge/YuE2--3B-374151?logo=huggingface&amp;logoColor=FFD21E" height="20" /></a>
35
+ &nbsp;
36
+ <a href="https://huggingface.co/m-a-p/YuE2-Vae"><img alt="🤗 YuE2-Vae" src="https://img.shields.io/badge/YuE2--Vae-374151?logo=huggingface&amp;logoColor=FFD21E" height="20" /></a>
37
+ &nbsp;
38
+ <a href="https://huggingface.co/m-a-p/YuE2-Vae-legacy"><img alt="🤗 YuE2-Vae-legacy" src="https://img.shields.io/badge/YuE2--Vae--legacy-374151?logo=huggingface&amp;logoColor=FFD21E" height="20" /></a>
39
+ &nbsp;
40
+ <a href="https://huggingface.co/m-a-p/MERT-v2-30s"><img alt="🤗 MERT-v2-30s" src="https://img.shields.io/badge/MERT--v2--30s-374151?logo=huggingface&amp;logoColor=FFD21E" height="20" /></a>
41
+ &nbsp;
42
+ <a href="https://huggingface.co/m-a-p/MERT-v2-FullSong"><img alt="🤗 MERT-v2-FullSong" src="https://img.shields.io/badge/MERT--v2--FullSong-374151?logo=huggingface&amp;logoColor=FFD21E" height="20" /></a>
43
+ &nbsp;
44
+ <a href="https://huggingface.co/datasets/m-a-p/WildSongBench"><img alt="🤗 WildSongBench" src="https://img.shields.io/badge/WildSongBench-374151?logo=huggingface&amp;logoColor=FFD21E" height="20" /></a>
45
+ &nbsp;
46
+ <a href="https://huggingface.co/m-a-p/SheetSage2"><img alt="SheetSage2" src="https://img.shields.io/badge/SheetSage2-374151?logo=huggingface&amp;logoColor=FFD21E" height="20" /></a>
47
+ </p>
48
+
49
+ WildSongBench (WSB) contains **192 song-generation prompts: 94 Chinese and 98 English**, used in the [YuE2 benchmarks](https://huggingface.co/m-a-p/YuE2-3B#benchmarks). This repository provides prompts, exact inputs and seeds, reference scores, and a minimal evaluator for **SongBench, Q3O, MuQ-MuLan, AllMusicCaps and Qwen3-ASR PER**. Audio is not included.
50
+
51
+ <a id="dataset"></a>
52
+ <a id="quick-start"></a>
53
+
54
+ ## 🚀 Quick start
55
+
56
+ ```python
57
+ from datasets import load_dataset
58
+
59
+ wsb = load_dataset("m-a-p/WildSongBench", split="test")
60
+ ```
61
+
62
+ Each record contains a `prompt`. [Generation inputs](benchmark/reproduction_manifest.jsonl) contain the corresponding style, lyrics and exact seeds for every prompt.
63
+
64
+ <a id="benchmark-results"></a>
65
+ <a id="benchmarks"></a>
66
+
67
+ ## 📊 Benchmarks
68
+
69
+ Recorded paper results on all 192 prompts. SongBench averages seven quality dimensions; Q3O measures prompt control on a 0–5 scale. MuQ-MuLan and AllMusicCaps measure audio–text similarity. PER is phoneme error rate.
70
+
71
+ | Model | Access | SongBench ↑ | Q3O ↑ | MuQ-MuLan ↑ | AllMusicCaps ↑ | PER ↓ |
72
+ |---|---|---:|---:|---:|---:|---:|
73
+ | YuE2 | Open weights | 6.73 | 4.68 | 0.507 | 0.405 | 8.44% |
74
+ | YuE2 (best-of-8) | Open weights | 6.96 | 4.70 | 0.505 | 0.398 | 9.79% |
75
+ | Mureka 9 | Proprietary | 6.94 | 4.64 | 0.439 | 0.410 | 11.69% |
76
+ | Suno v5 | Proprietary | 6.87 | 4.59 | 0.543 | 0.435 | 8.10% |
77
+ | Suno v5.5 | Proprietary | 6.71 | 4.59 | 0.509 | 0.392 | 5.96% |
78
+ | Suno v4.5 | Proprietary | 6.70 | 4.41 | 0.502 | 0.387 | 5.80% |
79
+ | LeVo 2 | Open weights | 6.32 | 3.95 | 0.354 | 0.268 | 26.12% |
80
+ | MiniMax Music 2.6 | Proprietary | 6.32 | 4.57 | 0.425 | 0.367 | 24.55% |
81
+ | MiniMax Music 3 | Open weights | 6.28 | 4.44 | 0.393 | 0.361 | 6.27% |
82
+ | HeartMuLa | Open weights | 6.25 | 3.49 | 0.382 | 0.279 | 10.71% |
83
+ | Muse | Open weights | 6.03 | 4.40 | 0.394 | 0.347 | 33.42% |
84
+ | ACE-Step 1.5 | Open weights | 6.01 | 4.58 | 0.437 | 0.387 | 7.46% |
85
+ | DiffRhythm 2 | Open weights | 5.24 | 4.09 | 0.378 | 0.325 | 18.41% |
86
+ | YuE 1 | Open weights | 4.92 | 3.73 | 0.262 | 0.288 | 36.38% |
87
+ | SongBloom | Open weights | 4.24 | 3.03 | 0.270 | 0.193 | 19.19% |
88
+
89
+ Systems use their recorded candidate-selection protocols; this is not a matched-compute comparison. [Full results and protocols](benchmark/comparison_summary.csv).
90
+
91
+ <a id="reproduce-standard-yue2"></a>
92
+
93
+ ## 🔁 Reproduce standard YuE2
94
+
95
+ Use [YuE2-3B](https://huggingface.co/m-a-p/YuE2-3B) with **[YuE2-Vae-legacy](https://huggingface.co/m-a-p/YuE2-Vae-legacy)** for benchmark scoring. The scripts pin the tested checkpoints and inference version. The benchmark recipe retains inference version 0.1.3 with updated public repository defaults; model weights and numerical inference code are unchanged.
96
+
97
+ Run from the downloaded repository in a fresh Python 3.12 environment on Linux, with a C/C++ compiler for Q3O's key scorer. **Q3O requires an 80 GB GPU; the other metrics support 24 GB.** Public evaluator weights download once at fixed revisions (~83 GB for all metrics). The installer creates the required environments. Select your GPU by its numeric index below.
98
+
99
+ ```bash
100
+ python -m pip install huggingface-hub==0.36.2
101
+ export CUDA_VISIBLE_DEVICES=0
102
+ python code/install_inference.py
103
+ tar --no-same-owner -xzf evaluation/wsb_metrics.tar.gz
104
+ python wsb_metrics/wsb_eval.py prepare \
105
+ --metrics all --download huggingface --install
106
+
107
+ python code/generate.py --candidates 2 --backend torch --output runs/wsb
108
+ python wsb_metrics/wsb_eval.py score \
109
+ --input runs/wsb/evaluation_inputs.jsonl \
110
+ --output runs/scores --mode standard --metrics per,songbench
111
+ python wsb_metrics/wsb_eval.py score \
112
+ --input runs/wsb/evaluation_inputs.jsonl \
113
+ --per-results runs/scores/per_song.jsonl \
114
+ --output runs/additional --metrics mulan,allmusiccaps,q3o
115
+ ```
116
+
117
+ For prompt row `i` (zero-based, 0–191), generate two candidates with seeds `831001 + i` and `831019 + i`. The script applies each seed to symbolic planning, semantic generation and acoustic synthesis. Four ASR passes estimate each candidate's PER; the lower-PER candidate is selected for every metric. Score all 192 prompts and retain capped outputs. Q3O uses the paper's fixed candidate weights and traditional key scoring. The scripts handle preprocessing and tie breaks.
118
+
119
+ On a 24 GB GPU, prepare `per,songbench,mulan,allmusiccaps` and omit `q3o` from the last command. The second scoring command reuses the first run's PER selection and evaluates exactly those 192 songs.
120
+
121
+ Selected scores are in `runs/scores/summary.json` (SongBench/PER) and `runs/additional/summary.json` (other metrics), under `standard_selected.groups.all`.
122
+
123
+ Fresh SongBench scores are **6.73 (H800)** and **6.74 (RTX 4090)**, against **6.73** in the paper. On the original 192 songs, MuQ-MuLan and AllMusicCaps mean scores match within 0.000001. Q3O gives **4.69 vs 4.68** on the original audio and **4.71** on fresh H800 generations; equality to two decimals remains unresolved. Best-of-8 has not been rerun in full.
124
+
125
+ <a id="citation"></a>
126
+
127
+ ## 📚 Citation
128
+
129
+ **Technical report coming soon.** For now, please cite [YuE](https://arxiv.org/abs/2503.08638) when using WildSongBench in your research.
130
+
131
+ ```bibtex
132
+ @article{yuan2025yue,
133
+ title = {{YuE}: Scaling Open Foundation Models for Long-Form Music Generation},
134
+ author = {Yuan, Ruibin and Lin, Hanfeng and Guo, Shuyue and Zhang, Ge and Pan, Jiahao and Zang, Yongyi and Liu, Haohe and Liang, Yiming and Ma, Wenye and Du, Xingjian and Du, Xinrun and Ye, Zhen and Zheng, Tianyu and Jiang, Zhengxuan and Ma, Yinghao and Liu, Minghao and Tian, Zeyue and Zhou, Ziya and Xue, Liumeng and Qu, Xingwei and Li, Yizhi and Wu, Shangda and Shen, Tianhao and Ma, Ziyang and Zhan, Jun and Wang, Chunhui and Wang, Yatian and Chi, Xiaowei and Zhang, Xinyue and Yang, Zhenzhu and Wang, Xiangzhou and Liu, Shansong and Mei, Lingrui and Li, Peng and Wang, Junjie and Yu, Jianwei and Pang, Guojian and Li, Xu and Wang, Zihao and Zhou, Xiaohuan and Yu, Lijun and Benetos, Emmanouil and Chen, Yong and Lin, Chenghua and Chen, Xie and Xia, Gus and Zhang, Zhaoxiang and Zhang, Chao and Chen, Wenhu and Zhou, Xinyu and Qiu, Xipeng and Dannenberg, Roger and Liu, Jiaheng and Yang, Jian and Huang, Wenhao and Xue, Wei and Tan, Xu and Guo, Yike},
135
+ journal = {arXiv preprint arXiv:2503.08638},
136
+ year = {2025},
137
+ eprint = {2503.08638},
138
+ archivePrefix = {arXiv},
139
+ url = {https://arxiv.org/abs/2503.08638}
140
+ }
141
+ ```
SHA256SUMS ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ 05ab7a768d2f01b9f4d87882357eec68da1b535a017d379d55187745cbbb2d96 README.md
2
+ 260a66760ddfcf10b3db48f150d0f905dbc777ee33af27789b69c98b160ac70c benchmark/comparison_summary.csv
3
+ 859e5225d319912efb64d587d1d5eb6cf0abc9fb162cc3d5f02d1688cff2edc0 benchmark/reproduction_manifest.jsonl
4
+ 41e069ed0f9d7fde27b277de40fe69d31fd0f5eed7a481b0af00e6486a6229c1 code/generate.py
5
+ 872a7c3e4a3ac5f842847f2909b82de59221d399ef3879a8310249f3ae11d81a code/install_inference.py
6
+ bd550b36f1fc43cad3254a9897dd3a078e50c4eb9e8d4f295ac4b5e81d1fc4fd evaluation/wsb_metrics.tar.gz
7
+ 1b554a824eba8e02eabe02299e48ed2215764931b8f05535cf8c6d250ddf8326 prompts.jsonl
benchmark/comparison_summary.csv ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ system,n,protocol,per,control_overall,songbench_global_avg,songeval_global_avg,audiobox_pq,mulan,allmusiccaps,audiobox_ce,audiobox_cu,audiobox_pc
2
+ YuE2,192,roll2 / four-ASR lower-PER selection,0.08443630690279864,4.681896986601725,6.731599404761909,4.262452916666666,8.25979095697403,0.5068482221880307,0.40536119728009606,7.5946645612518,7.883815668523312,6.329105652868748
3
+ YuE2 (best-of-8),192,best-of-8 / Musicality → Control → PER,0.09786539961704843,4.70087253751977,6.963229315476184,4.296048333333334,8.271365446348986,0.5050805467180908,0.398045457637636,7.585739687085152,7.882911428809166,6.349051711459954
4
+ ACE-Step 1.5,192,roll2 / four-ASR lower-PER selection,0.07457884998484957,4.580894501177339,6.011793824404761,3.846484166666666,8.051833018660545,0.43723272854307044,0.38685302749703016,7.345652607580026,7.696453630924225,6.559373706579208
5
+ DiffRhythm 2,192,roll2 / four-ASR lower-PER selection,0.18413265339015286,4.087044602340498,5.242845982142859,3.5244677083333333,7.978225273390611,0.37817035724098486,0.32549789230688475,7.221992149949074,7.5754738847414655,6.354656022042036
6
+ HeartMuLa,192,roll2 / four-ASR lower-PER selection,0.10705881594471056,3.490655976705673,6.248347544642855,4.551859166666667,8.293305036922296,0.3823466453177389,0.2786190857962841,7.695213384926319,7.913336729009946,6.434617171684901
7
+ LeVo 2,192,roll2 / four-ASR lower-PER selection,0.26116136186343974,3.9457878565807953,6.324671800595234,4.023369479166667,8.396623315910498,0.3542381529114209,0.2679880544101252,7.640917373200257,7.93210681527853,6.627885211259127
8
+ MiniMax Music 2.6,192,delivered candidate / stored ASR selection,0.24545647955335212,4.568809841873251,6.3221788690476215,4.098453333333334,8.171058195332686,0.42510899043797207,0.3669951342102043,7.385788751145204,7.8092692494392395,6.509756391247113
9
+ MiniMax Music 3,192,roll2 / four-ASR lower-PER selection / Standard + Official Rewriter,0.06268414232388418,4.43616720498247,6.282988392857145,4.099352187500001,8.28245102117459,0.39279851930526394,0.36085424468425725,7.516246639192104,7.886647321283817,6.417244121432304
10
+ Mureka 9,192,delivered candidate / stored ASR selection,0.11690337887061523,4.636807564214055,6.937748809523812,4.411131979166667,8.022609589000544,0.43942587031051517,0.41017753163275,7.425450682640076,7.709370714922746,6.665880647798379
11
+ Muse,192,roll2 / four-ASR lower-PER selection,0.33418648580693827,4.403758449771435,6.034903943452382,3.788667708333335,8.051745663086573,0.3936510290513979,0.3465821466803997,7.357404105365276,7.562788394590219,6.79859949896733
12
+ SongBloom,192,roll2 / four-ASR lower-PER selection; fixed prompt audio,0.19193351857701904,3.0286910546158463,4.235043750000001,3.2051130208333345,8.153916046023369,0.2697471845106823,0.19264957021005102,7.1598992844422655,7.663380955656369,4.881139911711216
13
+ Suno v4.5,192,delivered candidate / stored ASR selection,0.05798428222369787,4.41490242329515,6.699528199404766,4.366563958333332,8.254062737027803,0.5021767822715143,0.38734816436772235,7.566704971094926,7.847558493415515,6.4596482912699384
14
+ Suno v5,192,delivered candidate / stored ASR selection,0.080993611026942,4.5907186541713685,6.872074330357141,4.357936874999999,8.169838989774385,0.5428044088184834,0.43525151138116297,7.522664589186509,7.8013999834656715,6.551953633626302
15
+ Suno v5.5,192,delivered candidate / stored ASR selection,0.05958313723720433,4.591446755445953,6.714983407738093,4.2151607291666675,8.195489337046942,0.5088621161606474,0.3917035845806822,7.4402403980493546,7.9158454810579615,6.531025744974613
16
+ YuE 1,192,roll2 / four-ASR lower-PER selection,0.3637846445448743,3.7300764989993715,4.916463244047622,3.214967395833334,7.868339642882347,0.262323199029197,0.2881557388876293,6.952277842909098,7.441528876622518,5.72498715420564
benchmark/reproduction_manifest.jsonl ADDED
The diff for this file is too large to render. See raw diff
 
code/generate.py ADDED
@@ -0,0 +1,109 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Generate WSB candidates with pinned Hugging Face releases; never reuse audio."""
3
+ import argparse
4
+ import hashlib
5
+ import importlib.metadata
6
+ import json
7
+ import platform
8
+ from pathlib import Path
9
+
10
+ MODEL = "m-a-p/YuE2-3B"
11
+ MODEL_REVISION = "1a96eca688d6ae5d7f0feb88573fec89920fcd19"
12
+ VAE = "m-a-p/YuE2-Vae-legacy"
13
+ VAE_REVISION = "b54118f0fc462f08999d1ec07e88817f4ee3f770"
14
+ MODEL_SHA = "1d55c42c1a9875c34f5d736e15078449992b044e807ce2a138e6cf289a1e59e9"
15
+ VAE_SHA = "b6d283628913bb41145ba99e2314eef613905ee95f690eb70e8212d5f4965044"
16
+
17
+
18
+ def sha(path):
19
+ h = hashlib.sha256()
20
+ with Path(path).open("rb") as stream:
21
+ for block in iter(lambda: stream.read(8 << 20), b""):
22
+ h.update(block)
23
+ return h.hexdigest()
24
+
25
+
26
+ def main():
27
+ parser = argparse.ArgumentParser(description=__doc__)
28
+ parser.add_argument("--manifest", type=Path, default=Path(__file__).resolve().parents[1] / "benchmark/reproduction_manifest.jsonl")
29
+ parser.add_argument("--output", type=Path, required=True)
30
+ parser.add_argument("--candidates", type=int, choices=(2, 8), default=8)
31
+ parser.add_argument("--backend", choices=("torch", "torch-eager", "vllm"), default="torch")
32
+ parser.add_argument("--shard-index", type=int, default=0)
33
+ parser.add_argument("--num-shards", type=int, default=1)
34
+ parser.add_argument("--prompt-index", type=int, action="append", help="Optional diagnostic subset; repeat for multiple row indices")
35
+ parser.add_argument("--cache-dir", type=Path)
36
+ args = parser.parse_args()
37
+ if not 0 <= args.shard_index < args.num_shards:
38
+ parser.error("Require 0 <= shard-index < num-shards")
39
+ if args.prompt_index is not None and (len(set(args.prompt_index)) != len(args.prompt_index)
40
+ or any(not 0 <= i < 192 for i in args.prompt_index)):
41
+ parser.error("Prompt indices must be distinct integers from 0 to 191")
42
+ if args.output.exists() and any(args.output.iterdir()):
43
+ parser.error("Use a new output directory so previous candidates cannot be reused or overwritten")
44
+ all_rows = [json.loads(line) for line in args.manifest.read_text(encoding="utf-8").splitlines() if line.strip()]
45
+ assert len(all_rows) == 192 and [r["prompt_index"] for r in all_rows] == list(range(192))
46
+ bases = [831001, 831019, 831037, 831061, 831083, 831109, 831127, 831149]
47
+ for row in all_rows:
48
+ assert row["candidate_ar_seeds"] == [s + row["prompt_index"] for s in bases]
49
+ assert row["candidate_ar_seeds"] == row["candidate_nar_seeds"]
50
+ rows = [r for r in all_rows if r["prompt_index"] % args.num_shards == args.shard_index]
51
+ if args.prompt_index is not None:
52
+ rows = [r for r in rows if r["prompt_index"] in args.prompt_index]
53
+ assert rows
54
+ import torch
55
+ from yue2 import YuE2Pipeline
56
+ from yue2.protocol import SongRequest
57
+ from yue2.storage import verify_result
58
+ assert importlib.metadata.version("yue2-infer") == "0.1.3"
59
+ args.output.mkdir(parents=True, exist_ok=True)
60
+ evaluation_inputs = []
61
+ for row in rows:
62
+ for candidate_index, seed in enumerate(row["candidate_ar_seeds"][:args.candidates]):
63
+ ident = f"wsb_{row['prompt_index']:03d}_r{candidate_index}_s{seed}"
64
+ evaluation_inputs.append({"prompt_index": row["prompt_index"],
65
+ "candidate_index": candidate_index, "seed": seed,
66
+ "path": f"songs/{ident}"})
67
+ (args.output / "evaluation_inputs.jsonl").write_text(
68
+ "".join(json.dumps(row) + "\n" for row in evaluation_inputs))
69
+ report = {"model": MODEL, "model_revision": MODEL_REVISION, "vae": VAE,
70
+ "vae_revision": VAE_REVISION, "backend": args.backend,
71
+ "manifest_sha256": sha(args.manifest), "python": platform.python_version(),
72
+ "torch": torch.__version__, "gpu": torch.cuda.get_device_name(0),
73
+ "shard_index": args.shard_index, "num_shards": args.num_shards,
74
+ "prompt_indices": [r["prompt_index"] for r in rows],
75
+ "expected_candidates": len(rows) * args.candidates, "results": [], "complete": False}
76
+ with YuE2Pipeline.from_pretrained(MODEL, revision=MODEL_REVISION, vae=VAE,
77
+ vae_revision=VAE_REVISION, cache_dir=args.cache_dir,
78
+ backend=args.backend, device="cuda:0", memory_budget_gib=24) as pipe:
79
+ assert sha(pipe.model_dir / "model.safetensors") == MODEL_SHA
80
+ assert sha(pipe.vae_dir / "model.safetensors") == VAE_SHA
81
+ report["generation_config"] = pipe.generation_config.to_dict()
82
+ for row in rows:
83
+ for candidate_index, seed in enumerate(row["candidate_ar_seeds"][:args.candidates]):
84
+ ident = f"wsb_{row['prompt_index']:03d}_r{candidate_index}_s{seed}"
85
+ request = dict(id=ident, style=row["style"], lyrics=row["lyrics"],
86
+ cot="full", cfg_scale=1.0, seed=seed)
87
+ assert SongRequest(**request).text() == row["generation_prompt"]
88
+ result = {"id": ident, "prompt_index": row["prompt_index"],
89
+ "candidate_index": candidate_index, "seed": seed}
90
+ try:
91
+ song = pipe(**request)
92
+ song.save_artifacts(args.output / "songs" / ident)
93
+ receipt = verify_result(args.output / "songs" / ident)
94
+ result.update(status="complete", identity=receipt["identity"],
95
+ truncated=receipt["truncated"], audio_seconds=receipt["audio_seconds"])
96
+ del song
97
+ except Exception as exc:
98
+ result.update(status="failed", error=f"{type(exc).__name__}: {exc}")
99
+ report["results"].append(result)
100
+ (args.output / "generation_report.json").write_text(json.dumps(report, indent=2) + "\n")
101
+ print(json.dumps(result), flush=True)
102
+ report["complete"] = (len(report["results"]) == report["expected_candidates"]
103
+ and all(r["status"] == "complete" for r in report["results"]))
104
+ (args.output / "generation_report.json").write_text(json.dumps(report, indent=2) + "\n")
105
+ return 0 if report["complete"] else 1
106
+
107
+
108
+ if __name__ == "__main__":
109
+ raise SystemExit(main())
code/install_inference.py ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env python3
2
+ """Install the exact inference wheel used by this reproduction recipe."""
3
+ import hashlib
4
+ import argparse
5
+ import subprocess
6
+ import sys
7
+ from huggingface_hub import hf_hub_download
8
+
9
+ parser = argparse.ArgumentParser(description=__doc__)
10
+ parser.add_argument("--fast", action="store_true", help="Also install the released optional vLLM dependencies")
11
+ args = parser.parse_args()
12
+ wheel = hf_hub_download(
13
+ "m-a-p/YuE2-3B", "yue2_infer-0.1.3-py3-none-any.whl",
14
+ revision="1a96eca688d6ae5d7f0feb88573fec89920fcd19",
15
+ )
16
+ with open(wheel, "rb") as stream:
17
+ assert hashlib.sha256(stream.read()).hexdigest() == "156d6b8b7e46c3bd23cf22a50d3c20c403e5dc7f4a315582a224a840b01f4f07"
18
+ subprocess.check_call([sys.executable, "-m", "pip", "install", "--force-reinstall", "--no-deps", wheel])
19
+ subprocess.check_call([sys.executable, "-m", "pip", "install", wheel + ("[fast]" if args.fast else "")])
evaluation/wsb_metrics.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:bd550b36f1fc43cad3254a9897dd3a078e50c4eb9e8d4f295ac4b5e81d1fc4fd
3
+ size 505834965
prompts.jsonl ADDED
The diff for this file is too large to render. See raw diff