ESPnet JETS Text-to-Speech (TTS) Model for ONNX
imdanboy/jets exported to ONNX. This model is an ONNX export using the espnet_onnx library.
Usage with txtai
txtai has a built in Text to Speech (TTS) pipeline that makes using this model easy.
import soundfile as sf<br /> from txtai.pipeline import TextToSpeech<br /> # Build pipeline<br /> tts = TextToSpeech("NeuML/ljspeech-jets-onnx")<br /> # Generate speech<br /> speech = tts("Say something here")<br /> # Write to file<br /> sf.write("out.wav", speech, 22050)<br />
Usage with ONNX
This model can also be run directly with ONNX provided the input text is tokenized. Tokenization can be done with ttstokenizer.
Note that the txtai pipeline has additional functionality such as batching large inputs together that would need to be duplicated with this method.
import onnxruntime<br /> import soundfile as sf<br /> import yaml<br /> from ttstokenizer import TTSTokenizer<br /> # This example assumes the files have been downloaded locally<br /> with open("ljspeech-jets-onnx/config.yaml", "r", encoding="utf-8") as f:<br /> config = yaml.safe_load(f)<br /> # Create model<br /> model = onnxruntime.InferenceSession(<br /> "ljspeech-jets-onnx/model.onnx",<br /> providers=["CPUExecutionProvider"]<br /> )<br /> # Create tokenizer<br /> tokenizer = TTSTokenizer(config["token"]["list"])<br /> # Tokenize inputs<br /> inputs = tokenizer("Say something here")<br /> # Generate speech<br /> outputs = model.run(None, {"text": inputs})<br /> # Write to file<br /> sf.write("out.wav", outputs[0], 22050)<br />
How to export
More information on how to export ESPnet models to ONNX can be found here.
收录说明:
1、本网页并非 NeuML/ljspeech-jets-onnx 官网网址页面,此页面内容编录于互联网,只作展示之用;2、如果有与 NeuML/ljspeech-jets-onnx 相关业务事宜,请访问其网站并获取联系方式;3、本站与 NeuML/ljspeech-jets-onnx 无任何关系,对于 NeuML/ljspeech-jets-onnx 网站中的信息,请用户谨慎辨识其真伪。4、本站收录 NeuML/ljspeech-jets-onnx 时,此站内容访问正常,如遇跳转非法网站,有可能此网站被非法入侵或者已更换新网址,导致旧网址被非法使用,5、如果你是网站站长或者负责人,不想被收录请邮件删除:i-hu#Foxmail.com (#换@)
前往AI网址导航
2、本站所有文章、图片、资源等如果未标明原创,均为收集自互联网公开资源;分享的图片、资源、视频等,出镜模特均为成年女性正常写真内容,版权归原作者所有,仅作为个人学习、研究以及欣赏!如有涉及下载请24小时内删除;
3、如果您发现本站上有侵犯您的权益的作品,请与我们取得联系,我们会及时修改、删除并致以最深的歉意。邮箱: i-hu#(#换@)foxmail.com