Spaces:
Runtime error
Runtime error
m4jbz
commited on
Commit
•
cd6ff39
1
Parent(s):
47265aa
removed all languajes but spanish
Browse files
model.py
CHANGED
@@ -265,428 +265,15 @@ def _get_vits_hf(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
|
|
265 |
|
266 |
@lru_cache(maxsize=10)
|
267 |
def get_pretrained_model(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
|
268 |
-
if repo_id in
|
269 |
-
return chinese_models[repo_id](repo_id, speed)
|
270 |
-
if repo_id in cantonese_models:
|
271 |
-
return cantonese_models[repo_id](repo_id, speed)
|
272 |
-
elif repo_id in english_models:
|
273 |
-
return english_models[repo_id](repo_id, speed)
|
274 |
-
elif repo_id in german_models:
|
275 |
-
return german_models[repo_id](repo_id, speed)
|
276 |
-
elif repo_id in spanish_models:
|
277 |
return spanish_models[repo_id](repo_id, speed)
|
278 |
-
elif repo_id in french_models:
|
279 |
-
return french_models[repo_id](repo_id, speed)
|
280 |
-
elif repo_id in ukrainian_models:
|
281 |
-
return ukrainian_models[repo_id](repo_id, speed)
|
282 |
-
elif repo_id in russian_models:
|
283 |
-
return russian_models[repo_id](repo_id, speed)
|
284 |
-
elif repo_id in arabic_models:
|
285 |
-
return arabic_models[repo_id](repo_id, speed)
|
286 |
-
elif repo_id in catalan_models:
|
287 |
-
return catalan_models[repo_id](repo_id, speed)
|
288 |
-
elif repo_id in czech_models:
|
289 |
-
return czech_models[repo_id](repo_id, speed)
|
290 |
-
elif repo_id in danish_models:
|
291 |
-
return danish_models[repo_id](repo_id, speed)
|
292 |
-
elif repo_id in greek_models:
|
293 |
-
return greek_models[repo_id](repo_id, speed)
|
294 |
-
elif repo_id in finnish_models:
|
295 |
-
return finnish_models[repo_id](repo_id, speed)
|
296 |
-
elif repo_id in hungarian_models:
|
297 |
-
return hungarian_models[repo_id](repo_id, speed)
|
298 |
-
elif repo_id in icelandic_models:
|
299 |
-
return icelandic_models[repo_id](repo_id, speed)
|
300 |
-
elif repo_id in italian_models:
|
301 |
-
return italian_models[repo_id](repo_id, speed)
|
302 |
-
elif repo_id in georgian_models:
|
303 |
-
return georgian_models[repo_id](repo_id, speed)
|
304 |
-
elif repo_id in kazakh_models:
|
305 |
-
return kazakh_models[repo_id](repo_id, speed)
|
306 |
-
elif repo_id in luxembourgish_models:
|
307 |
-
return luxembourgish_models[repo_id](repo_id, speed)
|
308 |
-
elif repo_id in nepali_models:
|
309 |
-
return nepali_models[repo_id](repo_id, speed)
|
310 |
-
elif repo_id in dutch_models:
|
311 |
-
return dutch_models[repo_id](repo_id, speed)
|
312 |
-
elif repo_id in norwegian_models:
|
313 |
-
return norwegian_models[repo_id](repo_id, speed)
|
314 |
-
elif repo_id in polish_models:
|
315 |
-
return polish_models[repo_id](repo_id, speed)
|
316 |
-
elif repo_id in portuguese_models:
|
317 |
-
return portuguese_models[repo_id](repo_id, speed)
|
318 |
-
elif repo_id in romanian_models:
|
319 |
-
return romanian_models[repo_id](repo_id, speed)
|
320 |
-
elif repo_id in slovak_models:
|
321 |
-
return slovak_models[repo_id](repo_id, speed)
|
322 |
-
elif repo_id in serbian_models:
|
323 |
-
return serbian_models[repo_id](repo_id, speed)
|
324 |
-
elif repo_id in swedish_models:
|
325 |
-
return swedish_models[repo_id](repo_id, speed)
|
326 |
-
elif repo_id in swahili_models:
|
327 |
-
return swahili_models[repo_id](repo_id, speed)
|
328 |
-
elif repo_id in turkish_models:
|
329 |
-
return turkish_models[repo_id](repo_id, speed)
|
330 |
-
elif repo_id in vietnamese_models:
|
331 |
-
return vietnamese_models[repo_id](repo_id, speed)
|
332 |
-
elif repo_id in bulgarian_models:
|
333 |
-
return bulgarian_models[repo_id](repo_id, speed)
|
334 |
-
elif repo_id in estonian_models:
|
335 |
-
return estonian_models[repo_id](repo_id, speed)
|
336 |
-
elif repo_id in irish_models:
|
337 |
-
return irish_models[repo_id](repo_id, speed)
|
338 |
-
elif repo_id in croatian_models:
|
339 |
-
return croatian_models[repo_id](repo_id, speed)
|
340 |
-
elif repo_id in lithuanian_models:
|
341 |
-
return lithuanian_models[repo_id](repo_id, speed)
|
342 |
-
elif repo_id in latvian_models:
|
343 |
-
return latvian_models[repo_id](repo_id, speed)
|
344 |
-
elif repo_id in maltese_models:
|
345 |
-
return maltese_models[repo_id](repo_id, speed)
|
346 |
-
elif repo_id in slovenian_models:
|
347 |
-
return slovenian_models[repo_id](repo_id, speed)
|
348 |
-
elif repo_id in bengali_models:
|
349 |
-
return bengali_models[repo_id](repo_id, speed)
|
350 |
-
elif repo_id in min_nan_models:
|
351 |
-
return min_nan_models[repo_id](repo_id, speed)
|
352 |
-
elif repo_id in thai_models:
|
353 |
-
return thai_models[repo_id](repo_id, speed)
|
354 |
-
elif repo_id in persian_models:
|
355 |
-
return persian_models[repo_id](repo_id, speed)
|
356 |
-
elif repo_id in korean_models:
|
357 |
-
return korean_models[repo_id](repo_id, speed)
|
358 |
-
elif repo_id in afrikaans_models:
|
359 |
-
return afrikaans_models[repo_id](repo_id, speed)
|
360 |
-
elif repo_id in gujarati_models:
|
361 |
-
return gujarati_models[repo_id](repo_id, speed)
|
362 |
-
elif repo_id in tswana_models:
|
363 |
-
return tswana_models[repo_id](repo_id, speed)
|
364 |
else:
|
365 |
raise ValueError(f"Unsupported repo_id: {repo_id}")
|
366 |
|
367 |
-
|
368 |
-
cantonese_models = {
|
369 |
-
"csukuangfj/vits-cantonese-hf-xiaomaiiwn": _get_vits_hf,
|
370 |
-
}
|
371 |
-
|
372 |
-
chinese_models = {
|
373 |
-
"csukuangfj/vits-piper-zh_CN-huayan-medium": _get_vits_piper,
|
374 |
-
"csukuangfj/vits-zh-hf-theresa": _get_vits_hf,
|
375 |
-
"csukuangfj/vits-zh-hf-eula": _get_vits_hf,
|
376 |
-
"csukuangfj/vits-zh-hf-echo": _get_vits_hf,
|
377 |
-
"csukuangfj/vits-zh-hf-bronya": _get_vits_hf,
|
378 |
-
"csukuangfj/vits-zh-aishell3": _get_vits_zh_aishell3,
|
379 |
-
"csukuangfj/vits-zh-hf-fanchen-wnj": _get_vits_hf,
|
380 |
-
"csukuangfj/vits-zh-hf-fanchen-C": _get_vits_hf,
|
381 |
-
"csukuangfj/vits-zh-hf-fanchen-ZhiHuiLaoZhe": _get_vits_hf,
|
382 |
-
"csukuangfj/vits-zh-hf-fanchen-ZhiHuiLaoZhe_new": _get_vits_hf,
|
383 |
-
"csukuangfj/vits-zh-hf-fanchen-unity": _get_vits_hf,
|
384 |
-
"csukuangfj/vits-zh-hf-doom": _get_vits_hf,
|
385 |
-
"csukuangfj/vits-zh-hf-zenyatta": _get_vits_hf, # 804
|
386 |
-
"csukuangfj/vits-zh-hf-abyssinvoker": _get_vits_hf,
|
387 |
-
"csukuangfj/vits-zh-hf-keqing": _get_vits_hf,
|
388 |
-
# "csukuangfj/vits-piper-zh_CN-huayan-x_low": _get_vits_piper,
|
389 |
-
}
|
390 |
-
|
391 |
-
english_models = {
|
392 |
-
"csukuangfj/vits-piper-en_US-glados": _get_vits_piper,
|
393 |
-
# coqui-ai
|
394 |
-
"csukuangfj/vits-coqui-en-ljspeech": _get_vits_piper,
|
395 |
-
"csukuangfj/vits-coqui-en-ljspeech-neon": _get_vits_piper,
|
396 |
-
"csukuangfj/vits-coqui-en-vctk": _get_vits_piper,
|
397 |
-
# piper, US
|
398 |
-
"csukuangfj/vits-piper-en_GB-sweetbbak-amy": _get_vits_piper,
|
399 |
-
"csukuangfj/vits-piper-en_US-amy-low": _get_vits_piper,
|
400 |
-
"csukuangfj/vits-piper-en_US-amy-medium": _get_vits_piper,
|
401 |
-
"csukuangfj/vits-piper-en_US-arctic-medium": _get_vits_piper, # 18 speakers
|
402 |
-
"csukuangfj/vits-piper-en_US-danny-low": _get_vits_piper,
|
403 |
-
"csukuangfj/vits-piper-en_US-hfc_male-medium": _get_vits_piper,
|
404 |
-
"csukuangfj/vits-piper-en_US-joe-medium": _get_vits_piper,
|
405 |
-
"csukuangfj/vits-piper-en_US-kathleen-low": _get_vits_piper,
|
406 |
-
"csukuangfj/vits-piper-en_US-kusal-medium": _get_vits_piper,
|
407 |
-
"csukuangfj/vits-piper-en_US-l2arctic-medium": _get_vits_piper, # 24 speakers
|
408 |
-
"csukuangfj/vits-piper-en_US-lessac-low": _get_vits_piper,
|
409 |
-
"csukuangfj/vits-piper-en_US-lessac-medium": _get_vits_piper,
|
410 |
-
"csukuangfj/vits-piper-en_US-lessac-high": _get_vits_piper,
|
411 |
-
"csukuangfj/vits-piper-en_US-libritts-high": _get_vits_piper, # 904 speakers
|
412 |
-
"csukuangfj/vits-piper-en_US-libritts_r-medium": _get_vits_piper, # 904 speakers
|
413 |
-
"csukuangfj/vits-piper-en_US-ryan-low": _get_vits_piper,
|
414 |
-
"csukuangfj/vits-piper-en_US-ryan-medium": _get_vits_piper,
|
415 |
-
"csukuangfj/vits-piper-en_US-ryan-high": _get_vits_piper,
|
416 |
-
# piper, GB
|
417 |
-
"csukuangfj/vits-piper-en_GB-alan-low": _get_vits_piper,
|
418 |
-
"csukuangfj/vits-piper-en_GB-alan-medium": _get_vits_piper,
|
419 |
-
"csukuangfj/vits-piper-en_GB-alba-medium": _get_vits_piper,
|
420 |
-
"csukuangfj/vits-piper-en_GB-jenny_dioco-medium": _get_vits_piper,
|
421 |
-
"csukuangfj/vits-piper-en_GB-northern_english_male-medium": _get_vits_piper,
|
422 |
-
"csukuangfj/vits-piper-en_GB-semaine-medium": _get_vits_piper,
|
423 |
-
"csukuangfj/vits-piper-en_GB-southern_english_female-low": _get_vits_piper,
|
424 |
-
"csukuangfj/vits-piper-en_GB-vctk-medium": _get_vits_piper,
|
425 |
-
#
|
426 |
-
"csukuangfj/vits-vctk": _get_vits_vctk, # 109 speakers
|
427 |
-
"csukuangfj/vits-ljs": _get_vits_ljs,
|
428 |
-
}
|
429 |
-
|
430 |
-
german_models = {
|
431 |
-
"csukuangfj/vits-coqui-de-css10": _get_vits_piper,
|
432 |
-
"csukuangfj/vits-piper-de_DE-eva_k-x_low": _get_vits_piper,
|
433 |
-
"csukuangfj/vits-piper-de_DE-karlsson-low": _get_vits_piper,
|
434 |
-
"csukuangfj/vits-piper-de_DE-kerstin-low": _get_vits_piper,
|
435 |
-
"csukuangfj/vits-piper-de_DE-pavoque-low": _get_vits_piper,
|
436 |
-
"csukuangfj/vits-piper-de_DE-ramona-low": _get_vits_piper,
|
437 |
-
"csukuangfj/vits-piper-de_DE-thorsten-low": _get_vits_piper,
|
438 |
-
"csukuangfj/vits-piper-de_DE-thorsten-medium": _get_vits_piper,
|
439 |
-
"csukuangfj/vits-piper-de_DE-thorsten-high": _get_vits_piper,
|
440 |
-
"csukuangfj/vits-piper-de_DE-thorsten_emotional-medium": _get_vits_piper, # 8 speakers
|
441 |
-
}
|
442 |
-
|
443 |
spanish_models = {
|
444 |
-
"csukuangfj/vits-coqui-es-css10": _get_vits_piper,
|
445 |
-
"csukuangfj/vits-piper-es-glados-medium": _get_vits_piper,
|
446 |
-
"csukuangfj/vits-piper-es_ES-carlfm-x_low": _get_vits_piper,
|
447 |
-
"csukuangfj/vits-piper-es_ES-davefx-medium": _get_vits_piper,
|
448 |
-
# "csukuangfj/vits-piper-es_ES-mls_10246-low": _get_vits_piper,
|
449 |
-
# "csukuangfj/vits-piper-es_ES-mls_9972-low": _get_vits_piper,
|
450 |
"csukuangfj/vits-piper-es_ES-sharvard-medium": _get_vits_piper, # 2 speakers
|
451 |
-
"csukuangfj/vits-piper-es_MX-ald-medium": _get_vits_piper,
|
452 |
-
"csukuangfj/vits-mimic3-es_ES-m-ailabs_low": _get_vits_piper,
|
453 |
-
}
|
454 |
-
|
455 |
-
french_models = {
|
456 |
-
"csukuangfj/vits-coqui-fr-css10": _get_vits_piper,
|
457 |
-
# "csukuangfj/vits-piper-fr_FR-gilles-low": _get_vits_piper,
|
458 |
-
# "csukuangfj/vits-piper-fr_FR-mls_1840-low": _get_vits_piper,
|
459 |
-
"csukuangfj/vits-piper-fr_FR-upmc-medium": _get_vits_piper, # 2 speakers, 0-femal, 1-male
|
460 |
-
"csukuangfj/vits-piper-fr_FR-siwis-low": _get_vits_piper, # female
|
461 |
-
"csukuangfj/vits-piper-fr_FR-siwis-medium": _get_vits_piper,
|
462 |
-
"csukuangfj/vits-piper-fr_FR-tjiho-model1": _get_vits_piper,
|
463 |
-
"csukuangfj/vits-piper-fr_FR-tjiho-model2": _get_vits_piper,
|
464 |
-
"csukuangfj/vits-piper-fr_FR-tjiho-model3": _get_vits_piper,
|
465 |
-
}
|
466 |
-
|
467 |
-
ukrainian_models = {
|
468 |
-
"csukuangfj/vits-piper-uk_UA-lada-x_low": _get_vits_piper,
|
469 |
-
"csukuangfj/vits-coqui-uk-mai": _get_vits_piper,
|
470 |
-
# "csukuangfj/vits-piper-uk_UA-ukrainian_tts-medium": _get_vits_piper, # does not work somehow
|
471 |
-
}
|
472 |
-
|
473 |
-
russian_models = {
|
474 |
-
"csukuangfj/vits-piper-ru_RU-denis-medium": _get_vits_piper,
|
475 |
-
"csukuangfj/vits-piper-ru_RU-dmitri-medium": _get_vits_piper,
|
476 |
-
"csukuangfj/vits-piper-ru_RU-irina-medium": _get_vits_piper,
|
477 |
-
"csukuangfj/vits-piper-ru_RU-ruslan-medium": _get_vits_piper,
|
478 |
-
}
|
479 |
-
|
480 |
-
arabic_models = {
|
481 |
-
"csukuangfj/vits-piper-ar_JO-kareem-low": _get_vits_piper,
|
482 |
-
"csukuangfj/vits-piper-ar_JO-kareem-medium": _get_vits_piper,
|
483 |
-
}
|
484 |
-
|
485 |
-
catalan_models = {
|
486 |
-
"csukuangfj/vits-piper-ca_ES-upc_ona-x_low": _get_vits_piper,
|
487 |
-
"csukuangfj/vits-piper-ca_ES-upc_ona-medium": _get_vits_piper,
|
488 |
-
"csukuangfj/vits-piper-ca_ES-upc_pau-x_low": _get_vits_piper,
|
489 |
-
}
|
490 |
-
|
491 |
-
czech_models = {
|
492 |
-
"csukuangfj/vits-piper-cs_CZ-jirka-low": _get_vits_piper,
|
493 |
-
"csukuangfj/vits-piper-cs_CZ-jirka-medium": _get_vits_piper,
|
494 |
-
"csukuangfj/vits-coqui-cs-cv": _get_vits_piper,
|
495 |
-
}
|
496 |
-
|
497 |
-
danish_models = {
|
498 |
-
"csukuangfj/vits-coqui-da-cv": _get_vits_piper,
|
499 |
-
"csukuangfj/vits-piper-da_DK-talesyntese-medium": _get_vits_piper,
|
500 |
-
}
|
501 |
-
|
502 |
-
greek_models = {
|
503 |
-
"csukuangfj/vits-piper-el_GR-rapunzelina-low": _get_vits_piper,
|
504 |
-
# "csukuangfj/vits-mimic3-el_GR-rapunzelina_low": _get_vits_piper,
|
505 |
-
}
|
506 |
-
|
507 |
-
finnish_models = {
|
508 |
-
"csukuangfj/vits-coqui-fi-css10": _get_vits_piper,
|
509 |
-
"csukuangfj/vits-piper-fi_FI-harri-low": _get_vits_piper,
|
510 |
-
"csukuangfj/vits-piper-fi_FI-harri-medium": _get_vits_piper,
|
511 |
-
"csukuangfj/vits-mimic3-fi_FI-harri-tapani-ylilammi_low": _get_vits_piper,
|
512 |
-
}
|
513 |
-
|
514 |
-
hungarian_models = {
|
515 |
-
# "csukuangfj/vits-coqui-hu-css10": _get_vits_piper,
|
516 |
-
"csukuangfj/vits-piper-hu_HU-anna-medium": _get_vits_piper,
|
517 |
-
"csukuangfj/vits-piper-hu_HU-berta-medium": _get_vits_piper,
|
518 |
-
"csukuangfj/vits-piper-hu_HU-imre-medium": _get_vits_piper,
|
519 |
-
"csukuangfj/vits-mimic3-hu_HU-diana-majlinger_low": _get_vits_piper,
|
520 |
-
}
|
521 |
-
|
522 |
-
icelandic_models = {
|
523 |
-
"csukuangfj/vits-piper-is_IS-bui-medium": _get_vits_piper,
|
524 |
-
"csukuangfj/vits-piper-is_IS-salka-medium": _get_vits_piper,
|
525 |
-
"csukuangfj/vits-piper-is_IS-steinn-medium": _get_vits_piper,
|
526 |
-
"csukuangfj/vits-piper-is_IS-ugla-medium": _get_vits_piper,
|
527 |
-
}
|
528 |
-
|
529 |
-
italian_models = {
|
530 |
-
"csukuangfj/vits-piper-it_IT-riccardo-x_low": _get_vits_piper,
|
531 |
-
}
|
532 |
-
|
533 |
-
georgian_models = {
|
534 |
-
"csukuangfj/vits-piper-ka_GE-natia-medium": _get_vits_piper,
|
535 |
-
}
|
536 |
-
|
537 |
-
kazakh_models = {
|
538 |
-
"csukuangfj/vits-piper-kk_KZ-iseke-x_low": _get_vits_piper,
|
539 |
-
"csukuangfj/vits-piper-kk_KZ-issai-high": _get_vits_piper,
|
540 |
-
"csukuangfj/vits-piper-kk_KZ-raya-x_low": _get_vits_piper,
|
541 |
-
}
|
542 |
-
|
543 |
-
luxembourgish_models = {
|
544 |
-
"csukuangfj/vits-piper-lb_LU-marylux-medium": _get_vits_piper,
|
545 |
-
}
|
546 |
-
|
547 |
-
nepali_models = {
|
548 |
-
"csukuangfj/vits-piper-ne_NP-google-medium": _get_vits_piper,
|
549 |
-
"csukuangfj/vits-piper-ne_NP-google-x_low": _get_vits_piper,
|
550 |
-
"csukuangfj/vits-mimic3-ne_NP-ne-google_low": _get_vits_piper,
|
551 |
-
}
|
552 |
-
|
553 |
-
dutch_models = {
|
554 |
-
"csukuangfj/vits-coqui-nl-css10": _get_vits_piper,
|
555 |
-
"csukuangfj/vits-piper-nl_BE-nathalie-medium": _get_vits_piper,
|
556 |
-
"csukuangfj/vits-piper-nl_BE-nathalie-x_low": _get_vits_piper,
|
557 |
-
"csukuangfj/vits-piper-nl_BE-rdh-medium": _get_vits_piper,
|
558 |
-
"csukuangfj/vits-piper-nl_BE-rdh-x_low": _get_vits_piper,
|
559 |
-
"csukuangfj/vits-piper-nl_NL-mls_5809-low": _get_vits_piper,
|
560 |
-
"csukuangfj/vits-piper-nl_NL-mls_7432-low": _get_vits_piper,
|
561 |
-
}
|
562 |
-
|
563 |
-
norwegian_models = {
|
564 |
-
"csukuangfj/vits-piper-no_NO-talesyntese-medium": _get_vits_piper,
|
565 |
-
}
|
566 |
-
|
567 |
-
polish_models = {
|
568 |
-
"csukuangfj/vits-coqui-pl-mai_female": _get_vits_piper,
|
569 |
-
"csukuangfj/vits-piper-pl_PL-darkman-medium": _get_vits_piper,
|
570 |
-
"csukuangfj/vits-piper-pl_PL-gosia-medium": _get_vits_piper,
|
571 |
-
"csukuangfj/vits-piper-pl_PL-mc_speech-medium": _get_vits_piper,
|
572 |
-
# "csukuangfj/vits-piper-pl_PL-mls_6892-low": _get_vits_piper,
|
573 |
-
"csukuangfj/vits-mimic3-pl_PL-m-ailabs_low": _get_vits_piper,
|
574 |
-
}
|
575 |
-
|
576 |
-
portuguese_models = {
|
577 |
-
"csukuangfj/vits-coqui-pt-cv": _get_vits_piper,
|
578 |
-
"csukuangfj/vits-piper-pt_BR-edresson-low": _get_vits_piper,
|
579 |
-
"csukuangfj/vits-piper-pt_BR-faber-medium": _get_vits_piper,
|
580 |
-
"csukuangfj/vits-piper-pt_PT-tugao-medium": _get_vits_piper,
|
581 |
}
|
582 |
|
583 |
-
romanian_models = {
|
584 |
-
"csukuangfj/vits-coqui-ro-cv": _get_vits_piper,
|
585 |
-
"csukuangfj/vits-piper-ro_RO-mihai-medium": _get_vits_piper,
|
586 |
-
}
|
587 |
-
|
588 |
-
|
589 |
-
slovak_models = {
|
590 |
-
"csukuangfj/vits-coqui-sk-cv": _get_vits_piper,
|
591 |
-
"csukuangfj/vits-piper-sk_SK-lili-medium": _get_vits_piper,
|
592 |
-
}
|
593 |
-
|
594 |
-
serbian_models = {
|
595 |
-
"csukuangfj/vits-piper-sr_RS-serbski_institut-medium": _get_vits_piper,
|
596 |
-
}
|
597 |
-
|
598 |
-
swedish_models = {
|
599 |
-
"csukuangfj/vits-coqui-sv-cv": _get_vits_piper,
|
600 |
-
"csukuangfj/vits-piper-sv_SE-nst-medium": _get_vits_piper,
|
601 |
-
}
|
602 |
-
|
603 |
-
swahili_models = {
|
604 |
-
"csukuangfj/vits-piper-sw_CD-lanfrica-medium": _get_vits_piper,
|
605 |
-
}
|
606 |
-
|
607 |
-
turkish_models = {
|
608 |
-
"csukuangfj/vits-piper-tr_TR-dfki-medium": _get_vits_piper,
|
609 |
-
"csukuangfj/vits-piper-tr_TR-fahrettin-medium": _get_vits_piper,
|
610 |
-
}
|
611 |
-
|
612 |
-
vietnamese_models = {
|
613 |
-
"csukuangfj/vits-piper-vi_VN-25hours_single-low": _get_vits_piper,
|
614 |
-
"csukuangfj/vits-piper-vi_VN-vais1000-medium": _get_vits_piper,
|
615 |
-
"csukuangfj/vits-piper-vi_VN-vivos-x_low": _get_vits_piper,
|
616 |
-
"csukuangfj/vits-mimic3-vi_VN-vais1000_low": _get_vits_piper,
|
617 |
-
}
|
618 |
-
|
619 |
-
bulgarian_models = {
|
620 |
-
"csukuangfj/vits-coqui-bg-cv": _get_vits_piper,
|
621 |
-
}
|
622 |
-
|
623 |
-
estonian_models = {
|
624 |
-
"csukuangfj/vits-coqui-et-cv": _get_vits_piper,
|
625 |
-
}
|
626 |
-
|
627 |
-
irish_models = {
|
628 |
-
"csukuangfj/vits-coqui-ga-cv": _get_vits_piper,
|
629 |
-
}
|
630 |
-
|
631 |
-
croatian_models = {
|
632 |
-
"csukuangfj/vits-coqui-hr-cv": _get_vits_piper,
|
633 |
-
}
|
634 |
-
|
635 |
-
lithuanian_models = {
|
636 |
-
"csukuangfj/vits-coqui-lt-cv": _get_vits_piper,
|
637 |
-
}
|
638 |
-
|
639 |
-
latvian_models = {
|
640 |
-
"csukuangfj/vits-coqui-lv-cv": _get_vits_piper,
|
641 |
-
}
|
642 |
-
|
643 |
-
maltese_models = {
|
644 |
-
"csukuangfj/vits-coqui-mt-cv": _get_vits_piper,
|
645 |
-
}
|
646 |
-
|
647 |
-
slovenian_models = {
|
648 |
-
"csukuangfj/vits-piper-sl_SI-artur-medium": _get_vits_piper,
|
649 |
-
"csukuangfj/vits-coqui-sl-cv": _get_vits_piper,
|
650 |
-
}
|
651 |
-
|
652 |
-
# Bangla
|
653 |
-
bengali_models = {
|
654 |
-
"csukuangfj/vits-coqui-bn-custom_female": _get_vits_piper,
|
655 |
-
"csukuangfj/vits-mimic3-bn-multi_low": _get_vits_piper,
|
656 |
-
}
|
657 |
-
|
658 |
-
min_nan_models = {
|
659 |
-
"csukuangfj/vits-mms-nan": _get_vits_mms,
|
660 |
-
}
|
661 |
-
|
662 |
-
thai_models = {
|
663 |
-
"csukuangfj/vits-mms-tha": _get_vits_mms,
|
664 |
-
}
|
665 |
-
|
666 |
-
persian_models = {
|
667 |
-
"csukuangfj/vits-piper-fa_IR-amir-medium": _get_vits_piper,
|
668 |
-
"csukuangfj/vits-piper-fa_IR-gyro-medium": _get_vits_piper,
|
669 |
-
"csukuangfj/vits-mimic3-fa-haaniye_low": _get_vits_piper,
|
670 |
-
}
|
671 |
-
|
672 |
-
korean_models = {
|
673 |
-
"csukuangfj/vits-mimic3-ko_KO-kss_low": _get_vits_piper,
|
674 |
-
}
|
675 |
-
|
676 |
-
|
677 |
-
afrikaans_models = {
|
678 |
-
"csukuangfj/vits-mimic3-af_ZA-google-nwu_low": _get_vits_piper,
|
679 |
-
}
|
680 |
-
|
681 |
-
gujarati_models = {
|
682 |
-
"csukuangfj/vits-mimic3-gu_IN-cmu-indic_low": _get_vits_piper,
|
683 |
-
}
|
684 |
-
|
685 |
-
tswana_models = {
|
686 |
-
"csukuangfj/vits-mimic3-tn_ZA-google-nwu_low": _get_vits_piper,
|
687 |
-
}
|
688 |
-
|
689 |
-
|
690 |
language_to_models = {
|
691 |
"Spanish": list(spanish_models.keys()),
|
692 |
}
|
|
|
265 |
|
266 |
@lru_cache(maxsize=10)
|
267 |
def get_pretrained_model(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
|
268 |
+
if repo_id in spanish_models:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
return spanish_models[repo_id](repo_id, speed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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