Michael Hansen
commited on
Commit
•
2525f22
1
Parent(s):
5e74c24
Add aliases
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- _script/voicefest.py +31 -4
- ca/ca_ES/upc_ona/x_low/ALIASES +1 -0
- ca/ca_ES/upc_pau/x_low/ALIASES +1 -0
- da/da_DK/talesyntese/medium/ALIASES +1 -0
- de/de_DE/eva_k/x_low/ALIASES +1 -0
- de/de_DE/karlsson/low/ALIASES +1 -0
- de/de_DE/kerstin/low/ALIASES +1 -0
- de/de_DE/pavoque/low/ALIASES +1 -0
- de/de_DE/ramona/low/ALIASES +1 -0
- de/de_DE/thorsten/low/ALIASES +1 -0
- en/en_GB/alan/low/ALIASES +1 -0
- en/en_GB/southern_english_female/low/ALIASES +1 -0
- en/en_US/amy/low/ALIASES +1 -0
- en/en_US/kathleen/low/ALIASES +1 -0
- en/en_US/lessac/low/ALIASES +1 -0
- en/en_US/lessac/medium/ALIASES +1 -0
- en/en_US/libritts/high/ALIASES +1 -0
- en/en_US/ryan/high/ALIASES +1 -0
- en/en_US/ryan/low/ALIASES +1 -0
- en/en_US/ryan/medium/ALIASES +1 -0
- es/es_ES/carlfm/x_low/ALIASES +1 -0
- es/es_ES/mls_10246/low/ALIASES +1 -0
- es/es_ES/mls_9972/low/ALIASES +1 -0
- fi/fi_FI/harri/low/ALIASES +1 -0
- fr/fr_FR/gilles/low/ALIASES +1 -0
- fr/fr_FR/mls_1840/low/ALIASES +1 -0
- fr/fr_FR/siwis/low/ALIASES +1 -0
- fr/fr_FR/siwis/medium/ALIASES +1 -0
- is/is_IS/bui/medium/ALIASES +1 -0
- is/is_IS/salka/medium/ALIASES +1 -0
- is/is_IS/steinn/medium/ALIASES +1 -0
- is/is_IS/ugla/medium/ALIASES +1 -0
- it/it_IT/riccardo/x_low/ALIASES +1 -0
- kk/kk_KZ/iseke/x_low/ALIASES +1 -0
- kk/kk_KZ/issai/high/ALIASES +1 -0
- kk/kk_KZ/raya/x_low/ALIASES +1 -0
- ne/ne_NP/google/medium/ALIASES +1 -0
- ne/ne_NP/google/x_low/ALIASES +1 -0
- nl/nl_BE/nathalie/x_low/ALIASES +1 -0
- nl/nl_BE/rdh/medium/ALIASES +1 -0
- nl/nl_BE/rdh/x_low/ALIASES +1 -0
- nl/nl_NL/mls_5809/low/ALIASES +1 -0
- nl/nl_NL/mls_7432/low/ALIASES +1 -0
- no/no_NO/talesyntese/medium/ALIASES +1 -0
- pl/pl_PL/mls_6892/low/ALIASES +1 -0
- pt/pt_BR/edresson/low/ALIASES +1 -0
- ru/ru_RU/irina/medium/ALIASES +1 -0
- uk/uk_UA/lada/x_low/ALIASES +1 -0
- vi/vi_VN/25hours_single/low/ALIASES +1 -0
- vi/vi_VN/vivos/x_low/ALIASES +1 -0
_script/voicefest.py
CHANGED
@@ -4,6 +4,7 @@ import json
|
|
4 |
import unittest
|
5 |
from dataclasses import dataclass
|
6 |
from pathlib import Path
|
|
|
7 |
|
8 |
_DIR = Path(__file__).parent
|
9 |
_REPO_DIR = _DIR.parent
|
@@ -48,6 +49,8 @@ _LANGUAGES = {
|
|
48 |
|
49 |
class VoiceTest(unittest.TestCase):
|
50 |
def test_voices(self):
|
|
|
|
|
51 |
for onnx_path in _REPO_DIR.rglob("*.onnx"):
|
52 |
with self.subTest(onnx_path=onnx_path):
|
53 |
self.assertGreater(onnx_path.stat().st_size, 0, "Empty onnx file")
|
@@ -109,8 +112,21 @@ class VoiceTest(unittest.TestCase):
|
|
109 |
file_quality, config["audio"]["quality"], "Wrong quality file"
|
110 |
)
|
111 |
|
112 |
-
|
113 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
114 |
runner = unittest.TextTestRunner()
|
115 |
runner.run(unittest.makeSuite(VoiceTest))
|
116 |
|
@@ -118,9 +134,10 @@ def run_tests():
|
|
118 |
# -----------------------------------------------------------------------------
|
119 |
|
120 |
|
121 |
-
def write_voices_json():
|
122 |
# {
|
123 |
# "<family>_<region>-<dataset>-<quality>": {
|
|
|
124 |
# "name": "<dataset>",
|
125 |
# "language": {
|
126 |
# "code": "<family>_<region>",
|
@@ -142,7 +159,8 @@ def write_voices_json():
|
|
142 |
# "md5_digest": str, // hex
|
143 |
# },
|
144 |
# ...
|
145 |
-
# }
|
|
|
146 |
# },
|
147 |
# ...
|
148 |
# }
|
@@ -164,7 +182,15 @@ def write_voices_json():
|
|
164 |
model_card_path = voice_dir / "MODEL_CARD"
|
165 |
assert model_card_path.exists(), f"Missing {model_card_path}"
|
166 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
167 |
voices[voice_key] = {
|
|
|
168 |
"name": dataset,
|
169 |
"language": {
|
170 |
"code": lang_code,
|
@@ -188,6 +214,7 @@ def write_voices_json():
|
|
188 |
model_card_path,
|
189 |
)
|
190 |
},
|
|
|
191 |
}
|
192 |
|
193 |
with open(_REPO_DIR / "voices.json", "w", encoding="utf-8") as voices_file:
|
|
|
4 |
import unittest
|
5 |
from dataclasses import dataclass
|
6 |
from pathlib import Path
|
7 |
+
from typing import Set
|
8 |
|
9 |
_DIR = Path(__file__).parent
|
10 |
_REPO_DIR = _DIR.parent
|
|
|
49 |
|
50 |
class VoiceTest(unittest.TestCase):
|
51 |
def test_voices(self):
|
52 |
+
used_aliases: Set[str] = set()
|
53 |
+
|
54 |
for onnx_path in _REPO_DIR.rglob("*.onnx"):
|
55 |
with self.subTest(onnx_path=onnx_path):
|
56 |
self.assertGreater(onnx_path.stat().st_size, 0, "Empty onnx file")
|
|
|
112 |
file_quality, config["audio"]["quality"], "Wrong quality file"
|
113 |
)
|
114 |
|
115 |
+
# Verify aliases are unique
|
116 |
+
aliases_path = onnx_path.parent / "ALIASES"
|
117 |
+
if aliases_path.exists():
|
118 |
+
with open(aliases_path, "r", encoding="utf-8") as aliases_file:
|
119 |
+
for alias in aliases_file:
|
120 |
+
alias = alias.strip()
|
121 |
+
self.assertNotIn(
|
122 |
+
alias,
|
123 |
+
used_aliases,
|
124 |
+
"Alias is already in use by another voice",
|
125 |
+
)
|
126 |
+
used_aliases.add(alias)
|
127 |
+
|
128 |
+
|
129 |
+
def run_tests() -> None:
|
130 |
runner = unittest.TextTestRunner()
|
131 |
runner.run(unittest.makeSuite(VoiceTest))
|
132 |
|
|
|
134 |
# -----------------------------------------------------------------------------
|
135 |
|
136 |
|
137 |
+
def write_voices_json() -> None:
|
138 |
# {
|
139 |
# "<family>_<region>-<dataset>-<quality>": {
|
140 |
+
# "key": "<voice_key>",
|
141 |
# "name": "<dataset>",
|
142 |
# "language": {
|
143 |
# "code": "<family>_<region>",
|
|
|
159 |
# "md5_digest": str, // hex
|
160 |
# },
|
161 |
# ...
|
162 |
+
# },
|
163 |
+
# "aliases": ["alias", ...],
|
164 |
# },
|
165 |
# ...
|
166 |
# }
|
|
|
182 |
model_card_path = voice_dir / "MODEL_CARD"
|
183 |
assert model_card_path.exists(), f"Missing {model_card_path}"
|
184 |
|
185 |
+
aliases: Set[str] = set()
|
186 |
+
aliases_path = voice_dir / "ALIASES"
|
187 |
+
if aliases_path.exists():
|
188 |
+
with open(aliases_path, "r", encoding="utf-8") as aliases_file:
|
189 |
+
for alias in aliases_file:
|
190 |
+
aliases.add(alias.strip())
|
191 |
+
|
192 |
voices[voice_key] = {
|
193 |
+
"key": voice_key,
|
194 |
"name": dataset,
|
195 |
"language": {
|
196 |
"code": lang_code,
|
|
|
214 |
model_card_path,
|
215 |
)
|
216 |
},
|
217 |
+
"aliases": sorted(list(aliases)),
|
218 |
}
|
219 |
|
220 |
with open(_REPO_DIR / "voices.json", "w", encoding="utf-8") as voices_file:
|
ca/ca_ES/upc_ona/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ca-upc_ona-x-low
|
ca/ca_ES/upc_pau/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ca-upc_pau-x-low
|
da/da_DK/talesyntese/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
da-nst_talesyntese-medium
|
de/de_DE/eva_k/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
de-eva_k-x-low
|
de/de_DE/karlsson/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
de-karlsson-low
|
de/de_DE/kerstin/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
de-kerstin-low
|
de/de_DE/pavoque/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
de-pavoque-low
|
de/de_DE/ramona/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
de-ramona-low
|
de/de_DE/thorsten/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
de-thorsten-low
|
en/en_GB/alan/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-gb-alan-low
|
en/en_GB/southern_english_female/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-gb-southern_english_female-low
|
en/en_US/amy/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-us-amy-low
|
en/en_US/kathleen/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-us-kathleen-low
|
en/en_US/lessac/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-us-lessac-low
|
en/en_US/lessac/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-us-lessac-medium
|
en/en_US/libritts/high/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-us-libritts-high
|
en/en_US/ryan/high/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-us-ryan-high
|
en/en_US/ryan/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-us-ryan-low
|
en/en_US/ryan/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
en-us-ryan-medium
|
es/es_ES/carlfm/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
es-carlfm-x-low
|
es/es_ES/mls_10246/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
es-mls_10246-low
|
es/es_ES/mls_9972/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
es-mls_9972-low
|
fi/fi_FI/harri/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fi-harri-low
|
fr/fr_FR/gilles/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fr-gilles-low
|
fr/fr_FR/mls_1840/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fr-mls_1840-low
|
fr/fr_FR/siwis/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fr-siwis-low
|
fr/fr_FR/siwis/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
fr-siwis-medium
|
is/is_IS/bui/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
is-bui-medium
|
is/is_IS/salka/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
is-salka-medium
|
is/is_IS/steinn/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
is-steinn-medium
|
is/is_IS/ugla/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
is-ugla-medium
|
it/it_IT/riccardo/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
it-riccardo_fasol-x-low
|
kk/kk_KZ/iseke/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
kk-iseke-x-low
|
kk/kk_KZ/issai/high/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
kk-issai-high
|
kk/kk_KZ/raya/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
kk-raya-x-low
|
ne/ne_NP/google/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ne-google-medium
|
ne/ne_NP/google/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ne-google-x-low
|
nl/nl_BE/nathalie/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
nl-nathalie-x-low
|
nl/nl_BE/rdh/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
nl-rdh-medium
|
nl/nl_BE/rdh/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
nl-rdh-x-low
|
nl/nl_NL/mls_5809/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
nl-mls_5809-low
|
nl/nl_NL/mls_7432/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
nl-mls_7432-low
|
no/no_NO/talesyntese/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
no-talesyntese-medium
|
pl/pl_PL/mls_6892/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pl-mls_6892-low
|
pt/pt_BR/edresson/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
pt-br-edresson-low
|
ru/ru_RU/irina/medium/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
ru-irinia-medium
|
uk/uk_UA/lada/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
uk-lada-x-low
|
vi/vi_VN/25hours_single/low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
vi-25hours-single-low
|
vi/vi_VN/vivos/x_low/ALIASES
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
vi-vivos-x-low
|