Michael Hansen commited on
Commit
2525f22
1 Parent(s): 5e74c24

Add aliases

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. _script/voicefest.py +31 -4
  2. ca/ca_ES/upc_ona/x_low/ALIASES +1 -0
  3. ca/ca_ES/upc_pau/x_low/ALIASES +1 -0
  4. da/da_DK/talesyntese/medium/ALIASES +1 -0
  5. de/de_DE/eva_k/x_low/ALIASES +1 -0
  6. de/de_DE/karlsson/low/ALIASES +1 -0
  7. de/de_DE/kerstin/low/ALIASES +1 -0
  8. de/de_DE/pavoque/low/ALIASES +1 -0
  9. de/de_DE/ramona/low/ALIASES +1 -0
  10. de/de_DE/thorsten/low/ALIASES +1 -0
  11. en/en_GB/alan/low/ALIASES +1 -0
  12. en/en_GB/southern_english_female/low/ALIASES +1 -0
  13. en/en_US/amy/low/ALIASES +1 -0
  14. en/en_US/kathleen/low/ALIASES +1 -0
  15. en/en_US/lessac/low/ALIASES +1 -0
  16. en/en_US/lessac/medium/ALIASES +1 -0
  17. en/en_US/libritts/high/ALIASES +1 -0
  18. en/en_US/ryan/high/ALIASES +1 -0
  19. en/en_US/ryan/low/ALIASES +1 -0
  20. en/en_US/ryan/medium/ALIASES +1 -0
  21. es/es_ES/carlfm/x_low/ALIASES +1 -0
  22. es/es_ES/mls_10246/low/ALIASES +1 -0
  23. es/es_ES/mls_9972/low/ALIASES +1 -0
  24. fi/fi_FI/harri/low/ALIASES +1 -0
  25. fr/fr_FR/gilles/low/ALIASES +1 -0
  26. fr/fr_FR/mls_1840/low/ALIASES +1 -0
  27. fr/fr_FR/siwis/low/ALIASES +1 -0
  28. fr/fr_FR/siwis/medium/ALIASES +1 -0
  29. is/is_IS/bui/medium/ALIASES +1 -0
  30. is/is_IS/salka/medium/ALIASES +1 -0
  31. is/is_IS/steinn/medium/ALIASES +1 -0
  32. is/is_IS/ugla/medium/ALIASES +1 -0
  33. it/it_IT/riccardo/x_low/ALIASES +1 -0
  34. kk/kk_KZ/iseke/x_low/ALIASES +1 -0
  35. kk/kk_KZ/issai/high/ALIASES +1 -0
  36. kk/kk_KZ/raya/x_low/ALIASES +1 -0
  37. ne/ne_NP/google/medium/ALIASES +1 -0
  38. ne/ne_NP/google/x_low/ALIASES +1 -0
  39. nl/nl_BE/nathalie/x_low/ALIASES +1 -0
  40. nl/nl_BE/rdh/medium/ALIASES +1 -0
  41. nl/nl_BE/rdh/x_low/ALIASES +1 -0
  42. nl/nl_NL/mls_5809/low/ALIASES +1 -0
  43. nl/nl_NL/mls_7432/low/ALIASES +1 -0
  44. no/no_NO/talesyntese/medium/ALIASES +1 -0
  45. pl/pl_PL/mls_6892/low/ALIASES +1 -0
  46. pt/pt_BR/edresson/low/ALIASES +1 -0
  47. ru/ru_RU/irina/medium/ALIASES +1 -0
  48. uk/uk_UA/lada/x_low/ALIASES +1 -0
  49. vi/vi_VN/25hours_single/low/ALIASES +1 -0
  50. 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
- def run_tests():
 
 
 
 
 
 
 
 
 
 
 
 
 
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