csukuangfj commited on
Commit
f7215c7
1 Parent(s): d42a943

add more english models

Browse files
Files changed (1) hide show
  1. model.py +27 -79
model.py CHANGED
@@ -114,59 +114,7 @@ def _get_vits_ljs(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
114
 
115
 
116
  @lru_cache(maxsize=10)
117
- def _get_vits_piper_de_DE(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
118
- assert repo_id in (
119
- "csukuangfj/vits-piper-de_DE-eva_k-x_low",
120
- "csukuangfj/vits-piper-de_DE-karlsson-low",
121
- "csukuangfj/vits-piper-de_DE-kerstin-low",
122
- "csukuangfj/vits-piper-de_DE-pavoque-low",
123
- "csukuangfj/vits-piper-de_DE-ramona-low",
124
- "csukuangfj/vits-piper-de_DE-thorsten-low",
125
- "csukuangfj/vits-piper-de_DE-thorsten-medium",
126
- "csukuangfj/vits-piper-de_DE-thorsten-high",
127
- "csukuangfj/vits-piper-de_DE-thorsten_emotional-medium",
128
- )
129
- n = len("vits-piper-")
130
- name = repo_id.split("/")[1][n:]
131
-
132
- model = get_file(
133
- repo_id=repo_id,
134
- filename=f"{name}.onnx",
135
- subfolder=".",
136
- )
137
-
138
- lexicon = get_file(
139
- repo_id=repo_id,
140
- filename="lexicon.txt",
141
- subfolder=".",
142
- )
143
-
144
- tokens = get_file(
145
- repo_id=repo_id,
146
- filename="tokens.txt",
147
- subfolder=".",
148
- )
149
-
150
- tts_config = sherpa_onnx.OfflineTtsConfig(
151
- model=sherpa_onnx.OfflineTtsModelConfig(
152
- vits=sherpa_onnx.OfflineTtsVitsModelConfig(
153
- model=model,
154
- lexicon=lexicon,
155
- tokens=tokens,
156
- length_scale=1.0 / speed,
157
- ),
158
- provider="cpu",
159
- debug=True,
160
- num_threads=2,
161
- )
162
- )
163
- tts = sherpa_onnx.OfflineTts(tts_config)
164
-
165
- return tts
166
-
167
-
168
- @lru_cache(maxsize=10)
169
- def _get_vits_piper_en_US(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
170
  n = len("vits-piper-")
171
  name = repo_id.split("/")[1][n:]
172
 
@@ -264,36 +212,36 @@ chinese_models = {
264
 
265
  english_models = {
266
  "csukuangfj/vits-vctk": _get_vits_vctk,
267
- "csukuangfj/vits-piper-en_US-amy-low": _get_vits_piper_en_US,
268
- "csukuangfj/vits-piper-en_US-amy-medium": _get_vits_piper_en_US,
269
- "csukuangfj/vits-piper-en_US-arctic-medium": _get_vits_piper_en_US,
270
- "csukuangfj/vits-piper-en_US-danny-low": _get_vits_piper_en_US,
271
- "csukuangfj/vits-piper-en_US-hfc_male-medium": _get_vits_piper_en_US,
272
- "csukuangfj/vits-piper-en_US-joe-medium": _get_vits_piper_en_US,
273
- "csukuangfj/vits-piper-en_US-kathleen-low": _get_vits_piper_en_US,
274
- "csukuangfj/vits-piper-en_US-kusal-medium": _get_vits_piper_en_US,
275
- "csukuangfj/vits-piper-en_US-l2arctic-medium": _get_vits_piper_en_US,
276
- "csukuangfj/vits-piper-en_US-lessac-low": _get_vits_piper_en_US,
277
- "csukuangfj/vits-piper-en_US-lessac-medium": _get_vits_piper_en_US,
278
- "csukuangfj/vits-piper-en_US-lessac-high": _get_vits_piper_en_US,
279
- "csukuangfj/vits-piper-en_US-libritts-high": _get_vits_piper_en_US,
280
- "csukuangfj/vits-piper-en_US-libritts_r-medium": _get_vits_piper_en_US,
281
- "csukuangfj/vits-piper-en_US-ryan-low": _get_vits_piper_en_US,
282
- "csukuangfj/vits-piper-en_US-ryan-medium": _get_vits_piper_en_US,
283
- "csukuangfj/vits-piper-en_US-ryan-high": _get_vits_piper_en_US,
284
  "csukuangfj/vits-ljs": _get_vits_ljs,
285
  }
286
 
287
  german_models = {
288
- "csukuangfj/vits-piper-de_DE-eva_k-x_low": _get_vits_piper_de_DE,
289
- "csukuangfj/vits-piper-de_DE-karlsson-low": _get_vits_piper_de_DE,
290
- "csukuangfj/vits-piper-de_DE-kerstin-low": _get_vits_piper_de_DE,
291
- "csukuangfj/vits-piper-de_DE-pavoque-low": _get_vits_piper_de_DE,
292
- "csukuangfj/vits-piper-de_DE-ramona-low": _get_vits_piper_de_DE,
293
- "csukuangfj/vits-piper-de_DE-thorsten-low": _get_vits_piper_de_DE,
294
- "csukuangfj/vits-piper-de_DE-thorsten-medium": _get_vits_piper_de_DE,
295
- "csukuangfj/vits-piper-de_DE-thorsten-high": _get_vits_piper_de_DE,
296
- "csukuangfj/vits-piper-de_DE-thorsten_emotional-medium": _get_vits_piper_de_DE,
297
  }
298
 
299
 
 
114
 
115
 
116
  @lru_cache(maxsize=10)
117
+ def _get_vits_piper(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  n = len("vits-piper-")
119
  name = repo_id.split("/")[1][n:]
120
 
 
212
 
213
  english_models = {
214
  "csukuangfj/vits-vctk": _get_vits_vctk,
215
+ "csukuangfj/vits-piper-en_US-amy-low": _get_vits_piper,
216
+ "csukuangfj/vits-piper-en_US-amy-medium": _get_vits_piper,
217
+ "csukuangfj/vits-piper-en_US-arctic-medium": _get_vits_piper,
218
+ "csukuangfj/vits-piper-en_US-danny-low": _get_vits_piper,
219
+ "csukuangfj/vits-piper-en_US-hfc_male-medium": _get_vits_piper,
220
+ "csukuangfj/vits-piper-en_US-joe-medium": _get_vits_piper,
221
+ "csukuangfj/vits-piper-en_US-kathleen-low": _get_vits_piper,
222
+ "csukuangfj/vits-piper-en_US-kusal-medium": _get_vits_piper,
223
+ "csukuangfj/vits-piper-en_US-l2arctic-medium": _get_vits_piper,
224
+ "csukuangfj/vits-piper-en_US-lessac-low": _get_vits_piper,
225
+ "csukuangfj/vits-piper-en_US-lessac-medium": _get_vits_piper,
226
+ "csukuangfj/vits-piper-en_US-lessac-high": _get_vits_piper,
227
+ "csukuangfj/vits-piper-en_US-libritts-high": _get_vits_piper,
228
+ "csukuangfj/vits-piper-en_US-libritts_r-medium": _get_vits_piper,
229
+ "csukuangfj/vits-piper-en_US-ryan-low": _get_vits_piper,
230
+ "csukuangfj/vits-piper-en_US-ryan-medium": _get_vits_piper,
231
+ "csukuangfj/vits-piper-en_US-ryan-high": _get_vits_piper,
232
  "csukuangfj/vits-ljs": _get_vits_ljs,
233
  }
234
 
235
  german_models = {
236
+ "csukuangfj/vits-piper-de_DE-eva_k-x_low": _get_vits_piper,
237
+ "csukuangfj/vits-piper-de_DE-karlsson-low": _get_vits_piper,
238
+ "csukuangfj/vits-piper-de_DE-kerstin-low": _get_vits_piper,
239
+ "csukuangfj/vits-piper-de_DE-pavoque-low": _get_vits_piper,
240
+ "csukuangfj/vits-piper-de_DE-ramona-low": _get_vits_piper,
241
+ "csukuangfj/vits-piper-de_DE-thorsten-low": _get_vits_piper,
242
+ "csukuangfj/vits-piper-de_DE-thorsten-medium": _get_vits_piper,
243
+ "csukuangfj/vits-piper-de_DE-thorsten-high": _get_vits_piper,
244
+ "csukuangfj/vits-piper-de_DE-thorsten_emotional-medium": _get_vits_piper,
245
  }
246
 
247