Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add kokoro tts #1679

Open
thewh1teagle opened this issue Jan 3, 2025 · 7 comments
Open

Add kokoro tts #1679

thewh1teagle opened this issue Jan 3, 2025 · 7 comments

Comments

@thewh1teagle
Copy link
Contributor

We can replicate it from https://github.com/thewh1teagle/kokoro-onnx

@giannik
Copy link

giannik commented Jan 11, 2025

this would be awesome

@Ar57m
Copy link

Ar57m commented Jan 17, 2025

@csukuangfj is there any plans to bring it to android apk engine?

@csukuangfj
Copy link
Collaborator

@csukuangfj is there any plans to bring it to android apk engine?

Yes. It is on the way. Will finish it today.

Please wait for the next release, v1.10.40

@csukuangfj
Copy link
Collaborator

@csukuangfj is there any plans to bring it to android apk engine?

@Ar57m Please see #1728

@Areopagitics
Copy link

Areopagitics commented Feb 3, 2025

Hello, I have two (hopefully small) requests:

  • Please support the optimized f16 version. It currently on works with the f32 version. Here is the link for all versions. This is the error: Opset 5 is under development and support for this is limited. The operator schemas and or other functionality may change before next ONNX release and in this case ONNX Runtime will not guarantee backward compatibility. Current official support for domain ai.onnx.ml is till opset 4.
  • Please support selecting all supported languages. A nice bonus would be to able to select speakers by their name. At the moment only en-us is supported, but there are 8 languages:
    🇺🇸 American English: 11F 9M
    🇬🇧 British English: 4F 4M
    🇯🇵 Japanese: 4F 1M
    🇨🇳 Mandarin Chinese: 4F 4M
    🇪🇸 Spanish: 1F 2M
    🇫🇷 French: 1F
    🇮🇳 Hindi: 2F 2M
    🇮🇹 Italian: 1F 1M
    🇧🇷 Brazilian Portuguese: 1F 2M

@csukuangfj
Copy link
Collaborator

Please support the optimized f16 version?

The error is due to onnxruntime. Could you ask the model author which version of onnxruntime supports this version of fp16 model. And whether it requires GPU or not.


Please support selecting all supported languages

We are supporting English and Chinese, please see #1788

For other languages, we need your help or help from the community.

@Areopagitics
Copy link

@csukuangfj Thanks for getting back so quick!

Could you ask the model author which version of onnxruntime supports this version of fp16 model. And whether it requires GPU or not.

It looks like version 1.20. The answer is from running the code below. It should support GPU but don't think it requires it.

import onnx
model = onnx.load('kokoro-quant-gpu.onnx')
opset_imports = model.opset_import
for opset in opset_imports:
    print(f"Domain: {opset.domain}, Version: {opset.version}")

results:

Domain: , Version: 20
Domain: com.microsoft.experimental, Version: 1
Domain: ai.onnx.ml, Version: 5
Domain: ai.onnx.training, Version: 1
Domain: com.microsoft, Version: 1
Domain: ai.onnx.preview.training, Version: 1
Domain: com.microsoft.nchwc, Version: 1
Domain: org.pytorch.aten, Version: 1

For other languages, we need your help or help from the community.

Would it be possible to add --kokoro-lang argument to the sherpa-onnx-offline-tts binary? The default way of running it using kokoro_onnx is by passing a language id.

from kokoro_onnx import Kokoro
text = """...."""
kokoro = Kokoro("kokoro-quant-gpu.onnx", "voices.bin")
samples, sample_rate = kokoro.create(
    text, voice="af_heart", speed=0.95, lang="en-us", trim=False
)

Here is the updated language info:

language Espeak-ng fallback lang_code in misaki[en]
American English en-us a
British English en-gb b
Brazilian Portuguese pt-br p
Italian it i
Hindi hi h
French fr-fr f
Spanish es e
Mandarin Chinese   z
Japanese   j

ids

af_alloy
af_aoede
af_bella
af_heart
af_jessica
af_kore
af_nicole
af_nova
af_river
af_sarah
af_sky
am_adam
am_echo
am_eric
am_fenrir
am_liam
am_michael
am_onyx
am_puck
am_santa
bf_alice
bf_emma
bf_isabella
bf_lily
bm_daniel
bm_fable
bm_george
bm_lewis
ef_dora
em_alex
em_santa
ff_siwis
hf_alpha
hf_beta
hm_omega
hm_psi
if_sara
im_nicola
jf_alpha
jf_gongitsune
jf_nezumi
jf_tebukuro
jm_kumo
pf_dora
pm_alex
pm_santa
zf_xiaobei
zf_xiaoni
zf_xiaoxiao
zf_xiaoyi
zm_yunjian
zm_yunxi
zm_yunxia
zm_yunyang

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants