ONNX export and model card
Browse files- README.md +70 -0
- aligner.onnx +3 -0
- boundary.onnx +3 -0
- config.json +108 -0
- tokenizer_config.json +50 -0
- vocab.json +33 -0
README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-4.0
|
| 3 |
+
base_model: MahmoudAshraf/mms-300m-1130-forced-aligner
|
| 4 |
+
library_name: onnx
|
| 5 |
+
pipeline_tag: automatic-speech-recognition
|
| 6 |
+
tags:
|
| 7 |
+
- forced-alignment
|
| 8 |
+
- singing
|
| 9 |
+
- lyrics-alignment
|
| 10 |
+
- ultrastar
|
| 11 |
+
- onnx
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# Tune Studio aligner
|
| 15 |
+
|
| 16 |
+
A CTC forced aligner for **sung** lyrics, plus a small head that finds where syllables start. Made for
|
| 17 |
+
Tune Studio, which times lyrics to a vocal stem to make UltraStar karaoke charts.
|
| 18 |
+
|
| 19 |
+
- `aligner.onnx`: [MahmoudAshraf/mms-300m-1130-forced-aligner](https://huggingface.co/MahmoudAshraf/mms-300m-1130-forced-aligner)
|
| 20 |
+
(Meta's MMS-300m wav2vec2, a speech aligner) fine-tuned on singing.
|
| 21 |
+
- `boundary.onnx`: a syllable-start head that reads the aligner's last hidden layer.
|
| 22 |
+
- `vocab.json`, `tokenizer_config.json`, `config.json`: the aligner's vocabulary and configuration, unchanged from the base model.
|
| 23 |
+
|
| 24 |
+
## Use
|
| 25 |
+
|
| 26 |
+
**aligner.onnx**: input `audio` `[batch, samples]` float32, 16 kHz mono, raw (not normalized). Outputs `logits`
|
| 27 |
+
`[batch, frames, 32]` (CTC, before log-softmax) and `hidden` `[batch, frames, 1024]`, one frame per 20 ms (320
|
| 28 |
+
samples). Run a song in 30 s windows with 2 s of context on each side, the way
|
| 29 |
+
[ctc-forced-aligner](https://github.com/MahmoudAshraf97/ctc-forced-aligner) does (`generate_emissions`), and keep
|
| 30 |
+
each window's middle 30 s. Text is romanized and tokenized as in ctc-forced-aligner.
|
| 31 |
+
|
| 32 |
+
**boundary.onnx**: input `hidden` `[1, frames, 1024]`, the aligner's hidden states for the **whole song** (the
|
| 33 |
+
windows joined). Output `probs` `[1, frames]`: the probability that a syllable starts in each 20 ms frame. Tune
|
| 34 |
+
Studio moves each aligned syllable start to a peak (≥ 0.3) within ±0.3 s, assigning each peak to at most one
|
| 35 |
+
syllable in order.
|
| 36 |
+
|
| 37 |
+
## Training
|
| 38 |
+
|
| 39 |
+
- Aligner: 4000 steps at learning rate 6e-5, feature encoder frozen, on about 39,000 sung lines from the
|
| 40 |
+
hand-made UltraStar charts of 669 songs (the train split), with CTC targets from the lyrics. Held-out CTC loss
|
| 41 |
+
2.81 → 0.77.
|
| 42 |
+
- Boundary head: Linear → bidirectional GRU (192) → Linear, trained on the same songs to predict the charts'
|
| 43 |
+
syllable starts (Gaussian targets, σ = 20 ms). On held-out songs, 79.6% of chart syllable starts have a peak
|
| 44 |
+
within ±40 ms and 94.0% within ±80 ms.
|
| 45 |
+
|
| 46 |
+
## Results
|
| 47 |
+
|
| 48 |
+
Measured once on 74 held-out songs, English and German, against their hand-made charts: Tune Studio's chart
|
| 49 |
+
pipeline today (this aligner, the boundary head, the note refiners and some rule changes) vs. its first version
|
| 50 |
+
(the stock aligner, no learned steps):
|
| 51 |
+
|
| 52 |
+
| | first version | today | songs better / worse |
|
| 53 |
+
|---|---|---|---|
|
| 54 |
+
| syllable F1 | 0.788 | 0.875 | 66 / 6 |
|
| 55 |
+
| note F1 | 0.609 | 0.698 | 67 / 5 |
|
| 56 |
+
| frame F1 | 0.526 | 0.589 | 60 / 10 |
|
| 57 |
+
| exact pitch | 0.792 | 0.851 | 69 / 4 |
|
| 58 |
+
|
| 59 |
+
On its own (same pipeline otherwise, 58 development songs), the fine-tuned aligner raised syllable F1 by 0.047 and
|
| 60 |
+
note F1 by 0.029, and the boundary head on top of it syllable F1 by another 0.026.
|
| 61 |
+
|
| 62 |
+
Both versions split words into syllables with tables built partly from the test charts, which flatters both,
|
| 63 |
+
German most; the difference between them is not affected.
|
| 64 |
+
|
| 65 |
+
The ONNX files were checked against the PyTorch models: identical CTC alignment paths and syllable-start peaks on
|
| 66 |
+
full songs.
|
| 67 |
+
|
| 68 |
+
## License
|
| 69 |
+
|
| 70 |
+
CC BY-NC 4.0, inherited from the MMS base model: free for non-commercial use, with attribution.
|
aligner.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:597a1d775df8f7fe3c94310568751ef9253645b4d8cdf21bb7a3da1ab80225a1
|
| 3 |
+
size 1262284621
|
boundary.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c408211885ef43a867cfb107e52eaa7399a3df84985764c578a72c8949252736
|
| 3 |
+
size 2570198
|
config.json
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_dropout": 0.0,
|
| 3 |
+
"adapter_attn_dim": null,
|
| 4 |
+
"adapter_kernel_size": 3,
|
| 5 |
+
"adapter_stride": 2,
|
| 6 |
+
"add_adapter": false,
|
| 7 |
+
"apply_spec_augment": true,
|
| 8 |
+
"architectures": [
|
| 9 |
+
"Wav2Vec2ForCTC"
|
| 10 |
+
],
|
| 11 |
+
"attention_dropout": 0.0,
|
| 12 |
+
"bos_token_id": 1,
|
| 13 |
+
"classifier_proj_size": 256,
|
| 14 |
+
"codevector_dim": 768,
|
| 15 |
+
"contrastive_logits_temperature": 0.1,
|
| 16 |
+
"conv_bias": true,
|
| 17 |
+
"conv_dim": [
|
| 18 |
+
512,
|
| 19 |
+
512,
|
| 20 |
+
512,
|
| 21 |
+
512,
|
| 22 |
+
512,
|
| 23 |
+
512,
|
| 24 |
+
512
|
| 25 |
+
],
|
| 26 |
+
"conv_kernel": [
|
| 27 |
+
10,
|
| 28 |
+
3,
|
| 29 |
+
3,
|
| 30 |
+
3,
|
| 31 |
+
3,
|
| 32 |
+
2,
|
| 33 |
+
2
|
| 34 |
+
],
|
| 35 |
+
"conv_stride": [
|
| 36 |
+
5,
|
| 37 |
+
2,
|
| 38 |
+
2,
|
| 39 |
+
2,
|
| 40 |
+
2,
|
| 41 |
+
2,
|
| 42 |
+
2
|
| 43 |
+
],
|
| 44 |
+
"ctc_loss_reduction": "mean",
|
| 45 |
+
"ctc_zero_infinity": true,
|
| 46 |
+
"diversity_loss_weight": 0.1,
|
| 47 |
+
"do_stable_layer_norm": true,
|
| 48 |
+
"dtype": "float32",
|
| 49 |
+
"eos_token_id": 2,
|
| 50 |
+
"feat_extract_activation": "gelu",
|
| 51 |
+
"feat_extract_dropout": 0.0,
|
| 52 |
+
"feat_extract_norm": "layer",
|
| 53 |
+
"feat_proj_dropout": 0.0,
|
| 54 |
+
"feat_quantizer_dropout": 0.0,
|
| 55 |
+
"final_dropout": 0.0,
|
| 56 |
+
"gradient_checkpointing": false,
|
| 57 |
+
"hidden_act": "gelu",
|
| 58 |
+
"hidden_dropout": 0.0,
|
| 59 |
+
"hidden_size": 1024,
|
| 60 |
+
"initializer_range": 0.02,
|
| 61 |
+
"intermediate_size": 4096,
|
| 62 |
+
"layer_norm_eps": 1e-05,
|
| 63 |
+
"layerdrop": 0.0,
|
| 64 |
+
"mask_feature_length": 10,
|
| 65 |
+
"mask_feature_min_masks": 0,
|
| 66 |
+
"mask_feature_prob": 0.0,
|
| 67 |
+
"mask_time_length": 10,
|
| 68 |
+
"mask_time_min_masks": 2,
|
| 69 |
+
"mask_time_prob": 0.0,
|
| 70 |
+
"model_type": "wav2vec2",
|
| 71 |
+
"num_adapter_layers": 3,
|
| 72 |
+
"num_attention_heads": 16,
|
| 73 |
+
"num_codevector_groups": 2,
|
| 74 |
+
"num_codevectors_per_group": 320,
|
| 75 |
+
"num_conv_pos_embedding_groups": 16,
|
| 76 |
+
"num_conv_pos_embeddings": 128,
|
| 77 |
+
"num_feat_extract_layers": 7,
|
| 78 |
+
"num_hidden_layers": 24,
|
| 79 |
+
"num_negatives": 100,
|
| 80 |
+
"output_hidden_size": 1024,
|
| 81 |
+
"pad_token_id": 0,
|
| 82 |
+
"proj_codevector_dim": 768,
|
| 83 |
+
"tdnn_dilation": [
|
| 84 |
+
1,
|
| 85 |
+
2,
|
| 86 |
+
3,
|
| 87 |
+
1,
|
| 88 |
+
1
|
| 89 |
+
],
|
| 90 |
+
"tdnn_dim": [
|
| 91 |
+
512,
|
| 92 |
+
512,
|
| 93 |
+
512,
|
| 94 |
+
512,
|
| 95 |
+
1500
|
| 96 |
+
],
|
| 97 |
+
"tdnn_kernel": [
|
| 98 |
+
5,
|
| 99 |
+
3,
|
| 100 |
+
3,
|
| 101 |
+
1,
|
| 102 |
+
1
|
| 103 |
+
],
|
| 104 |
+
"transformers_version": "5.19.0",
|
| 105 |
+
"use_weighted_layer_sum": false,
|
| 106 |
+
"vocab_size": 31,
|
| 107 |
+
"xvector_output_dim": 512
|
| 108 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<blank>",
|
| 5 |
+
"lstrip": true,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": true,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": false
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<pad>",
|
| 13 |
+
"lstrip": true,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": true,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": false
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": true,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": true,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": false
|
| 26 |
+
},
|
| 27 |
+
"3": {
|
| 28 |
+
"content": "<unk>",
|
| 29 |
+
"lstrip": true,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": true,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": false
|
| 34 |
+
}
|
| 35 |
+
},
|
| 36 |
+
"backend": "custom",
|
| 37 |
+
"bos_token": null,
|
| 38 |
+
"clean_up_tokenization_spaces": true,
|
| 39 |
+
"do_lower_case": false,
|
| 40 |
+
"eos_token": "</s>",
|
| 41 |
+
"is_local": false,
|
| 42 |
+
"local_files_only": false,
|
| 43 |
+
"model_max_length": 1000000000000000019884624838656,
|
| 44 |
+
"pad_token": "<pad>",
|
| 45 |
+
"replace_word_delimiter_char": " ",
|
| 46 |
+
"target_lang": null,
|
| 47 |
+
"tokenizer_class": "Wav2Vec2CTCTokenizer",
|
| 48 |
+
"unk_token": "<unk>",
|
| 49 |
+
"word_delimiter_token": "None"
|
| 50 |
+
}
|
vocab.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"'": 28,
|
| 3 |
+
"</s>": 2,
|
| 4 |
+
"<blank>": 0,
|
| 5 |
+
"<pad>": 1,
|
| 6 |
+
"<unk>": 3,
|
| 7 |
+
"a": 4,
|
| 8 |
+
"b": 20,
|
| 9 |
+
"c": 23,
|
| 10 |
+
"d": 16,
|
| 11 |
+
"e": 6,
|
| 12 |
+
"f": 27,
|
| 13 |
+
"g": 17,
|
| 14 |
+
"h": 18,
|
| 15 |
+
"i": 5,
|
| 16 |
+
"j": 25,
|
| 17 |
+
"k": 14,
|
| 18 |
+
"l": 15,
|
| 19 |
+
"m": 13,
|
| 20 |
+
"n": 7,
|
| 21 |
+
"o": 8,
|
| 22 |
+
"p": 21,
|
| 23 |
+
"q": 29,
|
| 24 |
+
"r": 12,
|
| 25 |
+
"s": 11,
|
| 26 |
+
"t": 10,
|
| 27 |
+
"u": 9,
|
| 28 |
+
"v": 24,
|
| 29 |
+
"w": 22,
|
| 30 |
+
"x": 30,
|
| 31 |
+
"y": 19,
|
| 32 |
+
"z": 26
|
| 33 |
+
}
|