Vaniq-Edge
Abiray's Vaniq-Edge: an 8.9M-parameter English VITS (text encoder, stochastic duration predictor, flow and HiFi-GAN vocoder) at 24 kHz, exported for loom.cpp.
This is a loom.cpp export: a single self-describing GGUF that carries its own graph topologies, tokenizer (if any) and driver script, produced by loom-exporter.
Original model
Exported from Abiray/Vaniq-Edge. The F32 file carries the same parameters unmodified, in loom.cpp's GGUF format;
the others are quantized from them (see Files).
License
mit, inherited from the base model above.
Language(s)
en
Usage
Run it with loom-py -- loom-py-rt on PyPI:
pip install -U "loom-py-rt[hub,phonemes]>=1.0.0"
NOTE: This is a work in progress. For now, in order to avoid license conflicts and keep
dependencies at a minimum, we opted for orthography2ipa as our "swiss-knife" phonemizer. For
deep-orthography languages like English, to get stressing rules and context-based phonemization, the
phonemizer must register a reference lexicon (e.g., ipa-dict) to get highly accurate phonemization.
Full quality can be achieved by phonemizing the text yourself using your engine of choice and feeding
it to the model via the argument phonemes as in the example below.
import loom
model = loom.Model.from_pretrained("loom-ai-org/vaniq-edge-loom", "vaniq-edge-f32.gguf")
# The built-in text door: orthography2ipa, plus the US English pronunciation lexicon that ships in this
# repo (hexgrad/misaki's, Apache-2.0). The model was trained on espeak-ng's IPA, declares it, and the
# door rewrites the G2P's output to espeak's conventions before encoding.
loom.phonemizers.set_lexicon("https://huggingface.co/loom-ai-org/vaniq-edge-loom/resolve/main/lexicons/en_US-misaki.tsv", language="en-US")
audio = model.text2speech.infer("hello world")
audio.save("hello.wav")
# Full quality, upstream's own front end: espeak-ng's IPA with stress and punctuation, encoded as given.
# from phonemizer import phonemize
# ipa = phonemize("Hello world.", language="en-us", backend="espeak", strip=True,
# preserve_punctuation=True, with_stress=True)
# audio = model.text2speech.infer(phonemes=ipa)
Streaming
# A sentence at a time: this file has no live path of its own, so the stream speaks the text one sentence
# per `infer` call (`stream.exact` is False: the joins differ from one call over the whole text). Play
# each piece as it comes.
stream = model.text2speech.stream("Hello there. How are you today?")
sizes = [len(piece) for piece in stream]
print(stream.exact, len(sizes), "pieces,", round(stream.seconds, 2), "s")
The layer underneath
The call above is the high-level door: one per task, named for the modality pair it maps between, with
the windowing, sampling and assembly this model needs already applied. Under it, model.infer(...)
passes your arguments straight to the driver this GGUF embeds -- which is where you go for a knob the
door does not name.
model.driver_source prints that driver, including a header comment documenting every argument it
accepts for this model, and is the authority on it. See loom-py for the API and
loom.cpp for what the engine does between the two.
Known limitations
The text door is not upstream's front end. Upstream phonemizes with espeak-ng (english_cleaners2), which is GPL-3 and not part of loom. Through text2speech.infer(text) with the bundled lexicon, this model scored 18.3% word error rate on 30 LibriSpeech sentences (Whisper small) against 9.8% with espeak-ng's phonemes. Without the lexicon, English is unintelligible. For upstream's quality, phonemize with espeak-ng yourself and pass phonemes= (see Usage).
Upstream's text normalisation is not reproduced: VaniqTTS spells numbers and currency with num2words before phonemizing; spell them out yourself.
Synthesis uses upstream's own defaults, noise_scale=0.333 and noise_scale_w=0.8 (both overridable, with seed=); length_scale= slows or speeds the speech. English only, one voice.
Files
One model in several precisions; every file carries the same graph and driver. The quantized ones pack the convolution and projection weights (loom-export --quantize <type>), so their numbers differ from the original model's by the amount noted.
vaniq-edge-f32.gguf-- full precision, 34.4 MB; upstream's waveform to 1.0e-5, upstream's own f32-vs-f64 spread.vaniq-edge-q8_0_pc.gguf-- 11.5 MB: the convolutions and projections (91% of the weights) in per-channel int8. Whisper's word error rate on 60 syntheses is 14.3% against F32's 14.0%.lexicons/en_US-misaki.tsv-- hexgrad/misaki's US English pronunciation dictionaries (us_gold.jsonoverus_silver.json, each word's default reading), Apache-2.0 (lexicons/LICENSE.misaki), asword<TAB>ipa-- the shapeloom.phonemizers.set_lexiconreads. Of the lexicons measured through the door it scored best on this model (CMUdict's 24.7%, ipa-dict's 21.7%).