Spaces:
Runtime error
Runtime error
csukuangfj
commited on
Commit
•
9e48595
1
Parent(s):
7fcf32c
add more models
Browse files
model.py
CHANGED
@@ -275,6 +275,48 @@ def get_pretrained_model(repo_id: str, speed: float) -> sherpa_onnx.OfflineTts:
|
|
275 |
return catalan_models[repo_id](repo_id, speed)
|
276 |
elif repo_id in czech_models:
|
277 |
return czech_models[repo_id](repo_id, speed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
278 |
else:
|
279 |
raise ValueError(f"Unsupported repo_id: {repo_id}")
|
280 |
|
@@ -398,6 +440,114 @@ czech_models = {
|
|
398 |
"csukuangfj/vits-piper-cs_CZ-jirka-medium": _get_vits_piper,
|
399 |
}
|
400 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
language_to_models = {
|
402 |
"English": list(english_models.keys()),
|
403 |
"Chinese (Mandarin, 普通话)": list(chinese_models.keys()),
|
@@ -405,9 +555,30 @@ language_to_models = {
|
|
405 |
"Arabic": list(arabic_models.keys()),
|
406 |
"Catalan": list(catalan_models.keys()),
|
407 |
"Czech": list(czech_models.keys()),
|
|
|
|
|
|
|
408 |
"French": list(french_models.keys()),
|
|
|
409 |
"German": list(german_models.keys()),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
410 |
"Russian": list(russian_models.keys()),
|
|
|
|
|
411 |
"Spanish": list(spanish_models.keys()),
|
|
|
|
|
|
|
412 |
"Ukrainian": list(ukrainian_models.keys()),
|
|
|
413 |
}
|
|
|
275 |
return catalan_models[repo_id](repo_id, speed)
|
276 |
elif repo_id in czech_models:
|
277 |
return czech_models[repo_id](repo_id, speed)
|
278 |
+
elif repo_id in danish_models:
|
279 |
+
return danish_models[repo_id](repo_id, speed)
|
280 |
+
elif repo_id in greek_models:
|
281 |
+
return greek_models[repo_id](repo_id, speed)
|
282 |
+
elif repo_id in finnish_models:
|
283 |
+
return finnish_models[repo_id](repo_id, speed)
|
284 |
+
elif repo_id in hungarian_models:
|
285 |
+
return hungarian_models[repo_id](repo_id, speed)
|
286 |
+
elif repo_id in icelandic_models:
|
287 |
+
return icelandic_models[repo_id](repo_id, speed)
|
288 |
+
elif repo_id in italian_models:
|
289 |
+
return italian_models[repo_id](repo_id, speed)
|
290 |
+
elif repo_id in georgian_models:
|
291 |
+
return georgian_models[repo_id](repo_id, speed)
|
292 |
+
elif repo_id in kazakh_models:
|
293 |
+
return kazakh_models[repo_id](repo_id, speed)
|
294 |
+
elif repo_id in luxembourgish_models:
|
295 |
+
return luxembourgish_models[repo_id](repo_id, speed)
|
296 |
+
elif repo_id in nepali_models:
|
297 |
+
return nepali_models[repo_id](repo_id, speed)
|
298 |
+
elif repo_id in dutch_models:
|
299 |
+
return dutch_models[repo_id](repo_id, speed)
|
300 |
+
elif repo_id in norwegian_models:
|
301 |
+
return norwegian_models[repo_id](repo_id, speed)
|
302 |
+
elif repo_id in polish_models:
|
303 |
+
return polish_models[repo_id](repo_id, speed)
|
304 |
+
elif repo_id in portuguese_models:
|
305 |
+
return portuguese_models[repo_id](repo_id, speed)
|
306 |
+
elif repo_id in romanian_models:
|
307 |
+
return romanian_models[repo_id](repo_id, speed)
|
308 |
+
elif repo_id in slovak_models:
|
309 |
+
return slovak_models[repo_id](repo_id, speed)
|
310 |
+
elif repo_id in serbian_models:
|
311 |
+
return serbian_models[repo_id](repo_id, speed)
|
312 |
+
elif repo_id in swedish_models:
|
313 |
+
return swedish_models[repo_id](repo_id, speed)
|
314 |
+
elif repo_id in swahili_models:
|
315 |
+
return swahili_models[repo_id](repo_id, speed)
|
316 |
+
elif repo_id in turkish_models:
|
317 |
+
return turkish_models[repo_id](repo_id, speed)
|
318 |
+
elif repo_id in vietnamese_models:
|
319 |
+
return vietnamese_models[repo_id](repo_id, speed)
|
320 |
else:
|
321 |
raise ValueError(f"Unsupported repo_id: {repo_id}")
|
322 |
|
|
|
440 |
"csukuangfj/vits-piper-cs_CZ-jirka-medium": _get_vits_piper,
|
441 |
}
|
442 |
|
443 |
+
danish_models = {
|
444 |
+
"csukuangfj/vits-piper-da_DK-talesyntese-medium": _get_vits_piper,
|
445 |
+
}
|
446 |
+
|
447 |
+
greek_models = {
|
448 |
+
"csukuangfj/vits-piper-el_GR-rapunzelina-low": _get_vits_piper,
|
449 |
+
}
|
450 |
+
|
451 |
+
finnish_models = {
|
452 |
+
"csukuangfj/vits-piper-fi_FI-harri-low": _get_vits_piper,
|
453 |
+
"csukuangfj/vits-piper-fi_FI-harri-medium": _get_vits_piper,
|
454 |
+
}
|
455 |
+
|
456 |
+
hungarian_models = {
|
457 |
+
"csukuangfj/vits-piper-hu_HU-anna-medium": _get_vits_piper,
|
458 |
+
"csukuangfj/vits-piper-hu_HU-berta-medium": _get_vits_piper,
|
459 |
+
"csukuangfj/vits-piper-hu_HU-imre-medium": _get_vits_piper,
|
460 |
+
}
|
461 |
+
|
462 |
+
icelandic_models = {
|
463 |
+
"csukuangfj/vits-piper-is_IS-bui-medium": _get_vits_piper,
|
464 |
+
"csukuangfj/vits-piper-is_IS-salka-medium": _get_vits_piper,
|
465 |
+
"csukuangfj/vits-piper-is_IS-steinn-medium": _get_vits_piper,
|
466 |
+
"csukuangfj/vits-piper-is_IS-ugla-medium": _get_vits_piper,
|
467 |
+
}
|
468 |
+
|
469 |
+
italian_models = {
|
470 |
+
"csukuangfj/vits-piper-it_IT-riccardo-x_low": _get_vits_piper,
|
471 |
+
}
|
472 |
+
|
473 |
+
georgian_models = {
|
474 |
+
"csukuangfj/vits-piper-ka_GE-natia-medium": _get_vits_piper,
|
475 |
+
}
|
476 |
+
|
477 |
+
kazakh_models = {
|
478 |
+
"csukuangfj/vits-piper-kk_KZ-iseke-x_low": _get_vits_piper,
|
479 |
+
"csukuangfj/vits-piper-kk_KZ-issai-high": _get_vits_piper,
|
480 |
+
"csukuangfj/vits-piper-kk_KZ-raya-x_low": _get_vits_piper,
|
481 |
+
}
|
482 |
+
|
483 |
+
luxembourgish_models = {
|
484 |
+
"csukuangfj/vits-piper-lb_LU-marylux-medium": _get_vits_piper,
|
485 |
+
}
|
486 |
+
|
487 |
+
nepali_models = {
|
488 |
+
"csukuangfj/vits-piper-ne_NP-google-medium": _get_vits_piper,
|
489 |
+
"csukuangfj/vits-piper-ne_NP-google-x_low": _get_vits_piper,
|
490 |
+
}
|
491 |
+
|
492 |
+
dutch_models = {
|
493 |
+
"csukuangfj/vits-piper-nl_BE-nathalie-medium": _get_vits_piper,
|
494 |
+
"csukuangfj/vits-piper-nl_BE-nathalie-x_low": _get_vits_piper,
|
495 |
+
"csukuangfj/vits-piper-nl_BE-rdh-medium": _get_vits_piper,
|
496 |
+
"csukuangfj/vits-piper-nl_BE-rdh-x_low": _get_vits_piper,
|
497 |
+
"csukuangfj/vits-piper-nl_NL-mls_5809-low": _get_vits_piper,
|
498 |
+
"csukuangfj/vits-piper-nl_NL-mls_7432-low": _get_vits_piper,
|
499 |
+
}
|
500 |
+
|
501 |
+
norwegian_models = {
|
502 |
+
"csukuangfj/vits-piper-no_NO-talesyntese-medium": _get_vits_piper,
|
503 |
+
}
|
504 |
+
|
505 |
+
polish_models = {
|
506 |
+
"csukuangfj/vits-piper-pl_PL-darkman-medium": _get_vits_piper,
|
507 |
+
"csukuangfj/vits-piper-pl_PL-gosia-medium": _get_vits_piper,
|
508 |
+
"csukuangfj/vits-piper-pl_PL-mc_speech-medium": _get_vits_piper,
|
509 |
+
"csukuangfj/vits-piper-pl_PL-mls_6892-low": _get_vits_piper,
|
510 |
+
}
|
511 |
+
|
512 |
+
portuguese_models = {
|
513 |
+
"csukuangfj/vits-piper-pt_BR-edresson-low": _get_vits_piper,
|
514 |
+
"csukuangfj/vits-piper-pt_BR-faber-medium": _get_vits_piper,
|
515 |
+
"csukuangfj/vits-piper-pt_PT-tugao-medium": _get_vits_piper,
|
516 |
+
}
|
517 |
+
|
518 |
+
romanian_models = {
|
519 |
+
"csukuangfj/vits-piper-ro_RO-mihai-medium": _get_vits_piper,
|
520 |
+
}
|
521 |
+
|
522 |
+
|
523 |
+
slovak_models = {
|
524 |
+
"csukuangfj/vits-piper-sk_SK-lili-medium": _get_vits_piper,
|
525 |
+
}
|
526 |
+
|
527 |
+
serbian_models = {
|
528 |
+
"csukuangfj/vits-piper-sr_RS-serbski_institut-medium": _get_vits_piper,
|
529 |
+
}
|
530 |
+
|
531 |
+
swedish_models = {
|
532 |
+
"csukuangfj/vits-piper-sv_SE-nst-medium": _get_vits_piper,
|
533 |
+
}
|
534 |
+
|
535 |
+
swahili_models = {
|
536 |
+
"csukuangfj/vits-piper-sw_CD-lanfrica-medium": _get_vits_piper,
|
537 |
+
}
|
538 |
+
|
539 |
+
turkish_models = {
|
540 |
+
"csukuangfj/vits-piper-tr_TR-dfki-medium": _get_vits_piper,
|
541 |
+
"csukuangfj/vits-piper-tr_TR-fahrettin-medium": _get_vits_piper,
|
542 |
+
}
|
543 |
+
|
544 |
+
vietnamese_models = {
|
545 |
+
"csukuangfj/vits-piper-vi_VN-25hours_single-low": _get_vits_piper,
|
546 |
+
"csukuangfj/vits-piper-vi_VN-vais1000-medium": _get_vits_piper,
|
547 |
+
"csukuangfj/vits-piper-vi_VN-vivos-x_low": _get_vits_piper,
|
548 |
+
}
|
549 |
+
|
550 |
+
|
551 |
language_to_models = {
|
552 |
"English": list(english_models.keys()),
|
553 |
"Chinese (Mandarin, 普通话)": list(chinese_models.keys()),
|
|
|
555 |
"Arabic": list(arabic_models.keys()),
|
556 |
"Catalan": list(catalan_models.keys()),
|
557 |
"Czech": list(czech_models.keys()),
|
558 |
+
"Danish": list(danish_models.keys()),
|
559 |
+
"Dutch": list(dutch_models.keys()),
|
560 |
+
"Finnish": list(finnish_models.keys()),
|
561 |
"French": list(french_models.keys()),
|
562 |
+
"Georgian": list(georgian_models.keys()),
|
563 |
"German": list(german_models.keys()),
|
564 |
+
"Greek": list(greek_models.keys()),
|
565 |
+
"Hungarian": list(hungarian_models.keys()),
|
566 |
+
"Icelandic": list(icelandic_models.keys()),
|
567 |
+
"Italian": list(italian_models.keys()),
|
568 |
+
"Kazakh": list(kazakh_models.keys()),
|
569 |
+
"Luxembourgish": list(luxembourgish_models.keys()),
|
570 |
+
"Nepali": list(nepali_models.keys()),
|
571 |
+
"Norwegian": list(norwegian_models.keys()),
|
572 |
+
"Polish": list(polish_models.keys()),
|
573 |
+
"Portuguese": list(portuguese_models.keys()),
|
574 |
+
"Romanian": list(romanian_models.keys()),
|
575 |
"Russian": list(russian_models.keys()),
|
576 |
+
"Serbian": list(serbian_models.keys()),
|
577 |
+
"Slovak": list(slovak_models.keys()),
|
578 |
"Spanish": list(spanish_models.keys()),
|
579 |
+
"Swahili": list(swahili_models.keys()),
|
580 |
+
"Swedish": list(swedish_models.keys()),
|
581 |
+
"Turkish": list(turkish_models.keys()),
|
582 |
"Ukrainian": list(ukrainian_models.keys()),
|
583 |
+
"Vietnamese": list(vietnamese_models.keys()),
|
584 |
}
|