Publish isles pooled voice bundle [Seamus]
Browse files- .gitattributes +6 -0
- CosyVoice-BlankEN/config.json +27 -0
- CosyVoice-BlankEN/generation_config.json +14 -0
- CosyVoice-BlankEN/merges.txt +0 -0
- CosyVoice-BlankEN/model.safetensors +3 -0
- CosyVoice-BlankEN/tokenizer_config.json +40 -0
- CosyVoice-BlankEN/vocab.json +0 -0
- README.md +138 -0
- anchor.txt +1 -0
- anchor.wav +3 -0
- asset/dingding.png +3 -0
- campplus.onnx +3 -0
- config.json +1 -0
- configuration.json +1 -0
- cosyvoice2.yaml +233 -0
- flow.pt +3 -0
- hift.pt +3 -0
- llm.pt +3 -0
- sample/sample_0.wav +3 -0
- sample/sample_1.wav +3 -0
- sample/sample_2.wav +3 -0
- sample/sanity.wav +3 -0
- speech_tokenizer_v2.batch.onnx +3 -0
- speech_tokenizer_v2.onnx +3 -0
- spk2info.pt +3 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,9 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
anchor.wav filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
asset/dingding.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
sample/sample_0.wav filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
sample/sample_1.wav filter=lfs diff=lfs merge=lfs -text
|
| 40 |
+
sample/sample_2.wav filter=lfs diff=lfs merge=lfs -text
|
| 41 |
+
sample/sanity.wav filter=lfs diff=lfs merge=lfs -text
|
CosyVoice-BlankEN/config.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Qwen2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attention_dropout": 0.0,
|
| 6 |
+
"bos_token_id": 151643,
|
| 7 |
+
"eos_token_id": 151645,
|
| 8 |
+
"hidden_act": "silu",
|
| 9 |
+
"hidden_size": 896,
|
| 10 |
+
"initializer_range": 0.02,
|
| 11 |
+
"intermediate_size": 4864,
|
| 12 |
+
"max_position_embeddings": 32768,
|
| 13 |
+
"max_window_layers": 24,
|
| 14 |
+
"model_type": "qwen2",
|
| 15 |
+
"num_attention_heads": 14,
|
| 16 |
+
"num_hidden_layers": 24,
|
| 17 |
+
"num_key_value_heads": 2,
|
| 18 |
+
"rms_norm_eps": 1e-06,
|
| 19 |
+
"rope_theta": 1000000.0,
|
| 20 |
+
"sliding_window": 32768,
|
| 21 |
+
"tie_word_embeddings": true,
|
| 22 |
+
"torch_dtype": "bfloat16",
|
| 23 |
+
"transformers_version": "4.40.1",
|
| 24 |
+
"use_cache": true,
|
| 25 |
+
"use_sliding_window": false,
|
| 26 |
+
"vocab_size": 151936
|
| 27 |
+
}
|
CosyVoice-BlankEN/generation_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 151643,
|
| 3 |
+
"pad_token_id": 151643,
|
| 4 |
+
"do_sample": true,
|
| 5 |
+
"eos_token_id": [
|
| 6 |
+
151645,
|
| 7 |
+
151643
|
| 8 |
+
],
|
| 9 |
+
"repetition_penalty": 1.1,
|
| 10 |
+
"temperature": 0.7,
|
| 11 |
+
"top_p": 0.8,
|
| 12 |
+
"top_k": 20,
|
| 13 |
+
"transformers_version": "4.37.0"
|
| 14 |
+
}
|
CosyVoice-BlankEN/merges.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
CosyVoice-BlankEN/model.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:130282af0dfa9fe5840737cc49a0d339d06075f83c5a315c3372c9a0740d0b96
|
| 3 |
+
size 988097824
|
CosyVoice-BlankEN/tokenizer_config.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"add_prefix_space": false,
|
| 3 |
+
"added_tokens_decoder": {
|
| 4 |
+
"151643": {
|
| 5 |
+
"content": "<|endoftext|>",
|
| 6 |
+
"lstrip": false,
|
| 7 |
+
"normalized": false,
|
| 8 |
+
"rstrip": false,
|
| 9 |
+
"single_word": false,
|
| 10 |
+
"special": true
|
| 11 |
+
},
|
| 12 |
+
"151644": {
|
| 13 |
+
"content": "<|im_start|>",
|
| 14 |
+
"lstrip": false,
|
| 15 |
+
"normalized": false,
|
| 16 |
+
"rstrip": false,
|
| 17 |
+
"single_word": false,
|
| 18 |
+
"special": true
|
| 19 |
+
},
|
| 20 |
+
"151645": {
|
| 21 |
+
"content": "<|im_end|>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": false,
|
| 24 |
+
"rstrip": false,
|
| 25 |
+
"single_word": false,
|
| 26 |
+
"special": true
|
| 27 |
+
}
|
| 28 |
+
},
|
| 29 |
+
"additional_special_tokens": ["<|im_start|>", "<|im_end|>"],
|
| 30 |
+
"bos_token": null,
|
| 31 |
+
"chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are a helpful assistant.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
| 32 |
+
"clean_up_tokenization_spaces": false,
|
| 33 |
+
"eos_token": "<|im_end|>",
|
| 34 |
+
"errors": "replace",
|
| 35 |
+
"model_max_length": 32768,
|
| 36 |
+
"pad_token": "<|endoftext|>",
|
| 37 |
+
"split_special_tokens": false,
|
| 38 |
+
"tokenizer_class": "Qwen2Tokenizer",
|
| 39 |
+
"unk_token": null
|
| 40 |
+
}
|
CosyVoice-BlankEN/vocab.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
README.md
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-sa-4.0
|
| 3 |
+
base_model: FunAudioLLM/CosyVoice2-0.5B
|
| 4 |
+
tags:
|
| 5 |
+
- nanites
|
| 6 |
+
- tts
|
| 7 |
+
- text-to-speech
|
| 8 |
+
- cosyvoice2
|
| 9 |
+
- anonymized-voice
|
| 10 |
+
- british-isles
|
| 11 |
+
- scottish
|
| 12 |
+
- irish
|
| 13 |
+
- welsh
|
| 14 |
+
- dialect
|
| 15 |
+
language:
|
| 16 |
+
- en
|
| 17 |
+
pipeline_tag: text-to-speech
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# nanites-isles-speech-{hamish,maisie,seamus,tegan,rhys}
|
| 21 |
+
|
| 22 |
+
Anonymized, dialect+gender-pooled British Isles English text-to-speech
|
| 23 |
+
voices — Scottish, Irish, and Welsh English as crowdsourced in the
|
| 24 |
+
**OpenSLR 83** dataset (Google, 2018–19). Built on
|
| 25 |
+
[CosyVoice2-0.5B](https://huggingface.co/FunAudioLLM/CosyVoice2-0.5B)
|
| 26 |
+
(Apache-2.0, from FunAudioLLM), fine-tuned separately per pool.
|
| 27 |
+
|
| 28 |
+
## Personas
|
| 29 |
+
|
| 30 |
+
Pooled voices ship under dialect-appropriate codenames so each identity
|
| 31 |
+
is a *persona*, never a single OpenSLR speaker:
|
| 32 |
+
|
| 33 |
+
| Persona | Dialect/gender | Pool | WER (medium.en) | Anon max cos |
|
| 34 |
+
|---|---|---|---|---|
|
| 35 |
+
| **Maisie** | Scottish female | 6 speakers / 54.4 min | 26%* | 0.911 |
|
| 36 |
+
| **Hamish** | Scottish male | 6 speakers / 53.4 min | 22%* | 0.782 |
|
| 37 |
+
| **Seamus** | Irish male | 3 speakers / 22.7 min (thin) | 4.2% | 0.895 |
|
| 38 |
+
| **Tegan** | Welsh female | 6 speakers / 60.1 min | 8.9% | 0.871 |
|
| 39 |
+
| **Rhys** | Welsh male | 6 speakers / 59.8 min | 0.0% | 0.883 |
|
| 40 |
+
|
| 41 |
+
\* Scots lines are deliberately written in Scots orthography (e.g.
|
| 42 |
+
"dinna fash", "ged your tea"); whisper normalizes them to standard
|
| 43 |
+
spelling, so WER is inflated by orthography, not speech errors. The
|
| 44 |
+
Irish/Welsh lines use standard English spelling and their WERs are
|
| 45 |
+
reflective.
|
| 46 |
+
|
| 47 |
+
In code/config the voices keep the functional names
|
| 48 |
+
`isles-speech-scottish-female` etc. (engine + dialect + gender are
|
| 49 |
+
metadata); the codenames are the display/persona names.
|
| 50 |
+
|
| 51 |
+
**Hugging Face repos are persona-named** (a persona gets its own repo;
|
| 52 |
+
a future voice gets a new codename, not a gender suffix):
|
| 53 |
+
|
| 54 |
+
- `Nanite-Labs/nanites-isles-speech-hamish` (Scottish male)
|
| 55 |
+
- `Nanite-Labs/nanites-isles-speech-maisie` (Scottish female)
|
| 56 |
+
- `Nanite-Labs/nanites-isles-speech-seamus` (Irish male)
|
| 57 |
+
- `Nanite-Labs/nanites-isles-speech-tegan` (Welsh female)
|
| 58 |
+
- `Nanite-Labs/nanites-isles-speech-rhys` (Welsh male)
|
| 59 |
+
|
| 60 |
+
## Why this approach
|
| 61 |
+
|
| 62 |
+
- **Engine.** Same rationale as the sister `smoky` suite: modern line is
|
| 63 |
+
**CosyVoice 2.0** (FunAudioLLM), Apache-2.0. **XTTS is retired** in
|
| 64 |
+
this project (dormant, CPML license, poor clustering/cloning control).
|
| 65 |
+
- **Identity.** A *regional anon voice* must not replicate any single
|
| 66 |
+
OpenSLR speaker. CosyVoice2 SFT collapses each dialect+gender pool
|
| 67 |
+
into **one pooled speaker ID** (`<|{pool}_pool|>`), so no single
|
| 68 |
+
speaker is recoverable at synthesis time.
|
| 69 |
+
- **Anonymization.** Generation feeds the pooled campplus embedding
|
| 70 |
+
(average of the pool's members) — no reference audio from any
|
| 71 |
+
individual. Max cosine of the pooled embedding to the closest member
|
| 72 |
+
is reported per voice above (0.78–0.91; smoky reference ~0.89–0.91).
|
| 73 |
+
**Seamus's pool is thin** (3 speakers — the smallest OpenSLR set; the
|
| 74 |
+
Irish female pool does not exist in OpenSLR 83, so Irish female is
|
| 75 |
+
not offered): its anonymization margin and training-data size are
|
| 76 |
+
inherently smaller than the 6-speaker pools.
|
| 77 |
+
|
| 78 |
+
## Stable persona (zero-shot anchoring)
|
| 79 |
+
|
| 80 |
+
SFT mode conditions identity only through the pooled embedding, and the
|
| 81 |
+
base speech flow can leak timbre from the token sequence — some
|
| 82 |
+
short/locked-phrase sentences **deterministically** land in a different
|
| 83 |
+
timbre region (diagnosed on Hamish: one sentence regen 3× identical but
|
| 84 |
+
cosine 0.58 from his anchor). Fix, adopted for all five voices:
|
| 85 |
+
**zero-shot anchoring.** Each voice dir carries `anchor.wav` +
|
| 86 |
+
`anchor.txt` (a pooled-blend clip chosen by the listener, so the anchor
|
| 87 |
+
is itself anonymized); `cosyvoice_infer` clones that clip's timbre for
|
| 88 |
+
every new sentence (cosine 0.83–0.94 vs the anchor across novel lines).
|
| 89 |
+
Inference is therefore persona-consistent per codename.
|
| 90 |
+
|
| 91 |
+
## Data & license
|
| 92 |
+
|
| 93 |
+
- **OpenSLR 83** — "Crowdsourced high-quality UK and Ireland English
|
| 94 |
+
Dialect speech data set" (Google, 2018–19), **CC BY-SA 4.0**.
|
| 95 |
+
Citation: Demirsahin et al., "Open-source Multi-speaker Corpora of
|
| 96 |
+
the English Accents in the British Isles", LREC 2020.
|
| 97 |
+
- **CC BY-SA carries over to these voices**: derivatives (incl.
|
| 98 |
+
synthesized redistribution) inherit share-alike. This differs from
|
| 99 |
+
smoky (public-domain Hall corpus).
|
| 100 |
+
- OpenSLR 83 offers 6 dialects × male/female; this release covers
|
| 101 |
+
Scottish (f+m), Irish (male), Welsh (f+m). The Irish female set is
|
| 102 |
+
not offered because OpenSLR 83 only ships `irish_english_male.zip`.
|
| 103 |
+
- Audio: 48 kHz mono studio recordings → pooled 24 kHz clean sets with
|
| 104 |
+
light spectral-gate denoise, energy-VAD trim, SNR ≥ 8 dB filter,
|
| 105 |
+
per-pool caps (6 speakers / ~60 min / 10 min per speaker).
|
| 106 |
+
|
| 107 |
+
## Training
|
| 108 |
+
|
| 109 |
+
- **Base:** `FunAudioLLM/CosyVoice2-0.5B` (llm + flow + hift).
|
| 110 |
+
- **Data:** pooled chunk sets → kaldi-style dirs (10% cv) → campplus
|
| 111 |
+
embeddings + speech tokens → parquet →
|
| 112 |
+
`cosyvoice/bin/train.py` (`--model llm`, 1×GPU, bf16 AMP,
|
| 113 |
+
constant-lr 1e-5, 60 epochs). One speaker ID per pool.
|
| 114 |
+
- **Guarding (8 GB GPU):** bitsandbytes AdamW8bit; non-LLM params
|
| 115 |
+
frozen; bf16; gradient checkpointing; `KEEP_CKPT=12` in-run pruning
|
| 116 |
+
of checkpoints (multi-speaker SFT writes ~1 GB/epoch → ~60 GB if
|
| 117 |
+
unpruned).
|
| 118 |
+
- **Outputs:** `llm_avg.pt` per voice (**best-8 by val loss** via
|
| 119 |
+
`average_model.py --val_best`); final voice dirs assembled with base
|
| 120 |
+
flow/hift + baked `spk2info.pt` + anchor + samples.
|
| 121 |
+
|
| 122 |
+
## Evaluation
|
| 123 |
+
|
| 124 |
+
- WER: whisper `medium.en` on novel pool dialect lines (see table;
|
| 125 |
+
target <12%; Scots lines orthography-inflated).
|
| 126 |
+
Tools: `experts/isles/eval_wer.py`, `eval_texts.py`.
|
| 127 |
+
- Anonymization: `check_anon.py` — pooled embedding max cosine to a
|
| 128 |
+
member, per voice (see table).
|
| 129 |
+
- Persona consistency: anchor-mode synthesis lands at cosine 0.83–0.94
|
| 130 |
+
vs the anchor across novel lines (vs 0.58 drift pre-fix).
|
| 131 |
+
|
| 132 |
+
## Report to User
|
| 133 |
+
|
| 134 |
+
- [x] Whisper WER < 12% on held-out lines (per voice; see table)
|
| 135 |
+
- [x] Anonymization check (max cos 0.78–0.91)
|
| 136 |
+
- [x] Persona-consistent anchored synthesis (0.83–0.94 vs anchor)
|
| 137 |
+
- [x] All five voices signed off by listening; training data pruned
|
| 138 |
+
- [ ] Publish zips via `publish_cosyvoice.py --voice ...` (or all)
|
anchor.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
Ah sure, we'll take the hurl down to the pitch if the rain holds off at all.
|
anchor.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f01d0d3b4695b4faacf71a3cc8b4e2300075a28bbd2102f63196069647badc4
|
| 3 |
+
size 172878
|
asset/dingding.png
ADDED
|
Git LFS Details
|
campplus.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a6ac6a63997761ae2997373e2ee1c47040854b4b759ea41ec48e4e42df0f4d73
|
| 3 |
+
size 28303423
|
config.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{}
|
configuration.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"framework":"Pytorch","task":"text-to-speech"}
|
cosyvoice2.yaml
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# set random seed, so that you may reproduce your result.
|
| 2 |
+
__set_seed1: !apply:random.seed [1986]
|
| 3 |
+
__set_seed2: !apply:numpy.random.seed [1986]
|
| 4 |
+
__set_seed3: !apply:torch.manual_seed [1986]
|
| 5 |
+
__set_seed4: !apply:torch.cuda.manual_seed_all [1986]
|
| 6 |
+
|
| 7 |
+
# fixed params
|
| 8 |
+
sample_rate: 24000
|
| 9 |
+
llm_input_size: 896
|
| 10 |
+
llm_output_size: 896
|
| 11 |
+
spk_embed_dim: 192
|
| 12 |
+
qwen_pretrain_path: ''
|
| 13 |
+
token_frame_rate: 25
|
| 14 |
+
token_mel_ratio: 2
|
| 15 |
+
|
| 16 |
+
# stream related params
|
| 17 |
+
chunk_size: 25 # streaming inference chunk size, in token
|
| 18 |
+
num_decoding_left_chunks: -1 # streaming inference flow decoder left chunk size, <0 means use all left chunks
|
| 19 |
+
|
| 20 |
+
# model params
|
| 21 |
+
# for all class/function included in this repo, we use !<name> or !<new> for intialization, so that user may find all corresponding class/function according to one single yaml.
|
| 22 |
+
# for system/third_party class/function, we do not require this.
|
| 23 |
+
llm: !new:cosyvoice.llm.llm.Qwen2LM
|
| 24 |
+
llm_input_size: !ref <llm_input_size>
|
| 25 |
+
llm_output_size: !ref <llm_output_size>
|
| 26 |
+
speech_token_size: 6561
|
| 27 |
+
length_normalized_loss: True
|
| 28 |
+
lsm_weight: 0
|
| 29 |
+
mix_ratio: [5, 15]
|
| 30 |
+
llm: !new:cosyvoice.llm.llm.Qwen2Encoder
|
| 31 |
+
pretrain_path: !ref <qwen_pretrain_path>
|
| 32 |
+
sampling: !name:cosyvoice.utils.common.ras_sampling
|
| 33 |
+
top_p: 0.8
|
| 34 |
+
top_k: 25
|
| 35 |
+
win_size: 10
|
| 36 |
+
tau_r: 0.1
|
| 37 |
+
|
| 38 |
+
flow: !new:cosyvoice.flow.flow.CausalMaskedDiffWithXvec
|
| 39 |
+
input_size: 512
|
| 40 |
+
output_size: 80
|
| 41 |
+
spk_embed_dim: !ref <spk_embed_dim>
|
| 42 |
+
output_type: 'mel'
|
| 43 |
+
vocab_size: 6561
|
| 44 |
+
input_frame_rate: !ref <token_frame_rate>
|
| 45 |
+
only_mask_loss: True
|
| 46 |
+
token_mel_ratio: !ref <token_mel_ratio>
|
| 47 |
+
pre_lookahead_len: 3
|
| 48 |
+
encoder: !new:cosyvoice.transformer.upsample_encoder.UpsampleConformerEncoder
|
| 49 |
+
output_size: 512
|
| 50 |
+
attention_heads: 8
|
| 51 |
+
linear_units: 2048
|
| 52 |
+
num_blocks: 6
|
| 53 |
+
dropout_rate: 0.1
|
| 54 |
+
positional_dropout_rate: 0.1
|
| 55 |
+
attention_dropout_rate: 0.1
|
| 56 |
+
normalize_before: True
|
| 57 |
+
input_layer: 'linear'
|
| 58 |
+
pos_enc_layer_type: 'rel_pos_espnet'
|
| 59 |
+
selfattention_layer_type: 'rel_selfattn'
|
| 60 |
+
input_size: 512
|
| 61 |
+
use_cnn_module: False
|
| 62 |
+
macaron_style: False
|
| 63 |
+
static_chunk_size: !ref <chunk_size>
|
| 64 |
+
decoder: !new:cosyvoice.flow.flow_matching.CausalConditionalCFM
|
| 65 |
+
in_channels: 240
|
| 66 |
+
n_spks: 1
|
| 67 |
+
spk_emb_dim: 80
|
| 68 |
+
cfm_params: !new:omegaconf.DictConfig
|
| 69 |
+
content:
|
| 70 |
+
sigma_min: 1e-06
|
| 71 |
+
solver: 'euler'
|
| 72 |
+
t_scheduler: 'cosine'
|
| 73 |
+
training_cfg_rate: 0.2
|
| 74 |
+
inference_cfg_rate: 0.7
|
| 75 |
+
reg_loss_type: 'l1'
|
| 76 |
+
estimator: !new:cosyvoice.flow.decoder.CausalConditionalDecoder
|
| 77 |
+
in_channels: 320
|
| 78 |
+
out_channels: 80
|
| 79 |
+
channels: [256]
|
| 80 |
+
dropout: 0.0
|
| 81 |
+
attention_head_dim: 64
|
| 82 |
+
n_blocks: 4
|
| 83 |
+
num_mid_blocks: 12
|
| 84 |
+
num_heads: 8
|
| 85 |
+
act_fn: 'gelu'
|
| 86 |
+
static_chunk_size: !ref <chunk_size> * <token_mel_ratio>
|
| 87 |
+
num_decoding_left_chunks: !ref <num_decoding_left_chunks>
|
| 88 |
+
|
| 89 |
+
hift: !new:cosyvoice.hifigan.generator.HiFTGenerator
|
| 90 |
+
in_channels: 80
|
| 91 |
+
base_channels: 512
|
| 92 |
+
nb_harmonics: 8
|
| 93 |
+
sampling_rate: !ref <sample_rate>
|
| 94 |
+
nsf_alpha: 0.1
|
| 95 |
+
nsf_sigma: 0.003
|
| 96 |
+
nsf_voiced_threshold: 10
|
| 97 |
+
upsample_rates: [8, 5, 3]
|
| 98 |
+
upsample_kernel_sizes: [16, 11, 7]
|
| 99 |
+
istft_params:
|
| 100 |
+
n_fft: 16
|
| 101 |
+
hop_len: 4
|
| 102 |
+
resblock_kernel_sizes: [3, 7, 11]
|
| 103 |
+
resblock_dilation_sizes: [[1, 3, 5], [1, 3, 5], [1, 3, 5]]
|
| 104 |
+
source_resblock_kernel_sizes: [7, 7, 11]
|
| 105 |
+
source_resblock_dilation_sizes: [[1, 3, 5], [1, 3, 5], [1, 3, 5]]
|
| 106 |
+
lrelu_slope: 0.1
|
| 107 |
+
audio_limit: 0.99
|
| 108 |
+
f0_predictor: !new:cosyvoice.hifigan.f0_predictor.ConvRNNF0Predictor
|
| 109 |
+
num_class: 1
|
| 110 |
+
in_channels: 80
|
| 111 |
+
cond_channels: 512
|
| 112 |
+
|
| 113 |
+
# gan related module
|
| 114 |
+
mel_spec_transform1: !name:matcha.utils.audio.mel_spectrogram
|
| 115 |
+
n_fft: 1920
|
| 116 |
+
num_mels: 80
|
| 117 |
+
sampling_rate: !ref <sample_rate>
|
| 118 |
+
hop_size: 480
|
| 119 |
+
win_size: 1920
|
| 120 |
+
fmin: 0
|
| 121 |
+
fmax: null
|
| 122 |
+
center: False
|
| 123 |
+
hifigan: !new:cosyvoice.hifigan.hifigan.HiFiGan
|
| 124 |
+
generator: !ref <hift>
|
| 125 |
+
discriminator: !new:cosyvoice.hifigan.discriminator.MultipleDiscriminator
|
| 126 |
+
mpd: !new:matcha.hifigan.models.MultiPeriodDiscriminator
|
| 127 |
+
mrd: !new:cosyvoice.hifigan.discriminator.MultiResSpecDiscriminator
|
| 128 |
+
mel_spec_transform: [
|
| 129 |
+
!ref <mel_spec_transform1>
|
| 130 |
+
]
|
| 131 |
+
|
| 132 |
+
# processor functions
|
| 133 |
+
parquet_opener: !name:cosyvoice.dataset.processor.parquet_opener
|
| 134 |
+
get_tokenizer: !name:cosyvoice.tokenizer.tokenizer.get_qwen_tokenizer
|
| 135 |
+
token_path: !ref <qwen_pretrain_path>
|
| 136 |
+
skip_special_tokens: True
|
| 137 |
+
allowed_special: 'all'
|
| 138 |
+
tokenize: !name:cosyvoice.dataset.processor.tokenize
|
| 139 |
+
get_tokenizer: !ref <get_tokenizer>
|
| 140 |
+
allowed_special: !ref <allowed_special>
|
| 141 |
+
filter: !name:cosyvoice.dataset.processor.filter
|
| 142 |
+
max_length: 40960
|
| 143 |
+
min_length: 100
|
| 144 |
+
token_max_length: 200
|
| 145 |
+
token_min_length: 1
|
| 146 |
+
resample: !name:cosyvoice.dataset.processor.resample
|
| 147 |
+
resample_rate: !ref <sample_rate>
|
| 148 |
+
truncate: !name:cosyvoice.dataset.processor.truncate
|
| 149 |
+
truncate_length: 24480 # must be a multiplier of hop_size
|
| 150 |
+
feat_extractor: !name:matcha.utils.audio.mel_spectrogram
|
| 151 |
+
n_fft: 1920
|
| 152 |
+
num_mels: 80
|
| 153 |
+
sampling_rate: !ref <sample_rate>
|
| 154 |
+
hop_size: 480
|
| 155 |
+
win_size: 1920
|
| 156 |
+
fmin: 0
|
| 157 |
+
fmax: 8000
|
| 158 |
+
center: False
|
| 159 |
+
compute_fbank: !name:cosyvoice.dataset.processor.compute_fbank
|
| 160 |
+
feat_extractor: !ref <feat_extractor>
|
| 161 |
+
compute_f0: !name:cosyvoice.dataset.processor.compute_f0
|
| 162 |
+
sample_rate: !ref <sample_rate>
|
| 163 |
+
hop_size: 480
|
| 164 |
+
parse_embedding: !name:cosyvoice.dataset.processor.parse_embedding
|
| 165 |
+
normalize: True
|
| 166 |
+
shuffle: !name:cosyvoice.dataset.processor.shuffle
|
| 167 |
+
shuffle_size: 1000
|
| 168 |
+
sort: !name:cosyvoice.dataset.processor.sort
|
| 169 |
+
sort_size: 500 # sort_size should be less than shuffle_size
|
| 170 |
+
batch: !name:cosyvoice.dataset.processor.batch
|
| 171 |
+
batch_type: 'dynamic'
|
| 172 |
+
max_frames_in_batch: 2000
|
| 173 |
+
padding: !name:cosyvoice.dataset.processor.padding
|
| 174 |
+
use_spk_embedding: False # change to True during sft
|
| 175 |
+
|
| 176 |
+
|
| 177 |
+
# dataset processor pipeline
|
| 178 |
+
data_pipeline: [
|
| 179 |
+
!ref <parquet_opener>,
|
| 180 |
+
!ref <tokenize>,
|
| 181 |
+
!ref <filter>,
|
| 182 |
+
!ref <resample>,
|
| 183 |
+
!ref <compute_fbank>,
|
| 184 |
+
!ref <parse_embedding>,
|
| 185 |
+
!ref <shuffle>,
|
| 186 |
+
!ref <sort>,
|
| 187 |
+
!ref <batch>,
|
| 188 |
+
!ref <padding>,
|
| 189 |
+
]
|
| 190 |
+
data_pipeline_gan: [
|
| 191 |
+
!ref <parquet_opener>,
|
| 192 |
+
!ref <tokenize>,
|
| 193 |
+
!ref <filter>,
|
| 194 |
+
!ref <resample>,
|
| 195 |
+
!ref <truncate>,
|
| 196 |
+
!ref <compute_fbank>,
|
| 197 |
+
!ref <compute_f0>,
|
| 198 |
+
!ref <parse_embedding>,
|
| 199 |
+
!ref <shuffle>,
|
| 200 |
+
!ref <sort>,
|
| 201 |
+
!ref <batch>,
|
| 202 |
+
!ref <padding>,
|
| 203 |
+
]
|
| 204 |
+
|
| 205 |
+
# llm flow train conf
|
| 206 |
+
train_conf:
|
| 207 |
+
optim: adam
|
| 208 |
+
optim_conf:
|
| 209 |
+
lr: 1e-5 # change to 1e-5 during sft
|
| 210 |
+
scheduler: constantlr # change to constantlr during sft
|
| 211 |
+
scheduler_conf:
|
| 212 |
+
warmup_steps: 2500
|
| 213 |
+
max_epoch: 200
|
| 214 |
+
grad_clip: 5
|
| 215 |
+
accum_grad: 2
|
| 216 |
+
log_interval: 100
|
| 217 |
+
save_per_step: -1
|
| 218 |
+
|
| 219 |
+
# gan train conf
|
| 220 |
+
train_conf_gan:
|
| 221 |
+
optim: adam
|
| 222 |
+
optim_conf:
|
| 223 |
+
lr: 0.0002 # use small lr for gan training
|
| 224 |
+
scheduler: constantlr
|
| 225 |
+
optim_d: adam
|
| 226 |
+
optim_conf_d:
|
| 227 |
+
lr: 0.0002 # use small lr for gan training
|
| 228 |
+
scheduler_d: constantlr
|
| 229 |
+
max_epoch: 200
|
| 230 |
+
grad_clip: 5
|
| 231 |
+
accum_grad: 1 # in gan training, accum_grad must be 1
|
| 232 |
+
log_interval: 100
|
| 233 |
+
save_per_step: -1
|
flow.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ff4c2f867674411e0a08cee702996df13fa67c1cd864c06108da88d16d088541
|
| 3 |
+
size 450575567
|
hift.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3386cc880324d4e98e05987b99107f49e40ed925b8ecc87c1f4939432d429879
|
| 3 |
+
size 83390254
|
llm.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:77fff91f5f29102fafb835e872cbab28ec6a5fe6519dfaf33216a013b0a30445
|
| 3 |
+
size 1307514801
|
sample/sample_0.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f01d0d3b4695b4faacf71a3cc8b4e2300075a28bbd2102f63196069647badc4
|
| 3 |
+
size 172878
|
sample/sample_1.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c9ed284cf11d39f1187c35fef1ca809e8b3d45bec14996e19971db7fd486415
|
| 3 |
+
size 188238
|
sample/sample_2.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bfc6d674e4888b346cbbe244db9106730c21d7c4a7ecdb45f7eb101e040a53d6
|
| 3 |
+
size 165198
|
sample/sanity.wav
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2f01d0d3b4695b4faacf71a3cc8b4e2300075a28bbd2102f63196069647badc4
|
| 3 |
+
size 172878
|
speech_tokenizer_v2.batch.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5b45a98572ed21e3a3ebf50201f3020567f7db40e9a57509b790b2982f5c07b7
|
| 3 |
+
size 496095794
|
speech_tokenizer_v2.onnx
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d43342aa12163a80bf07bffb94c9de2e120a8df2f9917cd2f642e7f4219c6f71
|
| 3 |
+
size 496082973
|
spk2info.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:69f873a9028f0cf443592c9914021abc96ced8135282762ee736c378ca67e2b9
|
| 3 |
+
size 2416
|