Model reference · open weights
ljspeech-jets-onnx is an open-weight audio or speech model from NeuML. AxForge deploys and operates it for you on dedicated EU-owned hardware — with the licence handled where one is required.
Available as managed deployment — configured and operated for you on dedicated EU hardware, quoted per deployment.
What it is
| Released by | NeuML |
|---|---|
| Type | Audio & music |
| Task | Text→speech |
| Runs with | txtai |
| Released | 2022-11-29 |
| Popularity | 10k downloads / month |
| Licence | Open weights |
About
imdanboy/jets exported to ONNX. This model is an ONNX export using the espnet_onnx library.
txtai has a built in Text to Speech (TTS) pipeline that makes using this model easy.
import soundfile as sf
from txtai.pipeline import TextToSpeech
# Build pipeline
tts = TextToSpeech("NeuML/ljspeech-jets-onnx")
# Generate speech
speech, rate = tts("Say something here")
# Write to file
sf.write("out.wav", speech, rate)
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
import soundfile as sf
import yaml
from ttstokenizer import TTSTokenizer
# This example assumes the files have been downloaded locally
with open("ljspeech-jets-onnx/config.yaml", "r", encoding="utf-8") as f:
config = yaml.safe_load(f)
# Create model
model = onnxruntime.InferenceSession(
"ljspeech-jets-onnx/model.onnx",
providers=["CPUExecutionProvider"]
)
# Create tokenizer
tokenizer = TTSTokenizer(config["token"]["list"])
# Tokenize inputs
inputs = tokenizer("Say something here")
# Generate speech
outputs = model.run(None, {"text": inputs})
# Write to file
sf.write("out.wav", outputs[0], 22050)
More information on how to export ESPnet models to ONNX can be found here.
From the published model card. Full card on the HuggingFace links in the sidebar.
How it works
Using it via the API
Once AxForge deploys ljspeech-jets-onnx for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (ljspeech-jets-onnx below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/audio/transcriptions \ -H "Authorization: Bearer $AXFORGE_API_KEY" \ -F model="ljspeech-jets-onnx" -F file=@audio.mp3
Create an account — your API key is available in the console. 3M free tokens every 30 days with every new account.