Model card for app developers: which version for English / Slovak, quick starts, browser and on-device use, Slovak samples
Browse filesFiles changed (6)
- .gitattributes+4
- README.md+177-56
- samples/sk_a_mena.wavAdded+3
- samples/sk_a_otazky.wavAdded+3
- samples/sk_a_pribeh.wavAdded+3
- samples/sk_a_spravy.wavAdded+3
32 unmodified lines33343532 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text32 unmodified lines3334353637383932 unmodified lines*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -textsamples/sk_a_spravy.wav filter=lfs diff=lfs merge=lfs -textsamples/sk_a_pribeh.wav filter=lfs diff=lfs merge=lfs -textsamples/sk_a_mena.wav filter=lfs diff=lfs merge=lfs -textsamples/sk_a_otazky.wav filter=lfs diff=lfs merge=lfs -text
3 unmodified lines45678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596 unmodified lines66676869707172737475767778798081828384858687888990919217 unmodified lines1101111121131141151161171181191201211221231241251261271285 unmodified lines1341351361373 unmodified lines- enlicense: cc-by-sa-4.0pipeline_tag: text-to-speechtags:- text-to-speech- slovak- onnx---# Regulus## VersionsOne repository, one model line. `main` is always the newest version; every release has a tag.| Version | What changed | Download ||---|---|---|| v1.0 | English base model: 590 voices, two speaking styles, fast mode, voice cloning (internal name v2.3) | `hf download mmmhusto/Regulus --revision v1.0` || v2.0 | Fine-tune of v1.0 on two voices: Studio 92 (Cori Samuel) and DailyTalk man | `hf download mmmhusto/Regulus --revision v2.0` || v2.1 | v2.0 with a fast mode (2-step decoder + Vocos, ~9x real time on a laptop CPU), voice cloning and a measured recipe for adding a voice (5 min of speech) | `hf download mmmhusto/Regulus --revision v2.1` || v3.0 | First bilingual try: v2.0 plus experimental Slovak (5 voices) | `hf download mmmhusto/Regulus --revision v3.0` || v4.0 | Slovak: three original Slovak voices, about 1 % character error rate, runs on CPU and in the browser | `hf download mmmhusto/Regulus --revision v4.0` || **v5.0** | **Slovak: one voice, `sk_a`, a real speaker's natural reading voice; foreign names read the way Slovaks say them, ten / jeden / mladé read hard, clearer ť ď ň** | `hf download mmmhusto/Regulus --revision v5.0` |**This page describes v5.0, the Slovak model.** For English use **v2.1** (or v2.0); the three synthetic Slovak voices(sk_f3, sk_f2, sk_m1) stay in **v4.0**. The [demo](https://huggingface.co/spaces/mmmhusto/TTS-English-demo) has bothlanguages.## The voice| Voice | Sound | Built from ||---|---|---|| `sk_a` | man, natural reading voice | one anonymous Slovak Mozilla Common Voice contributor (3 h, CC0) |`sk_a` is the voice of a real, anonymous person who gave their recordings to Mozilla Common Voice under CC0. Please donot use it to impersonate anyone or to try to identify the speaker.## Quality105 Slovak sentences the model never trained on, read by this package (onnxruntime, 10 decoder steps): 64 dense inť ď ň ľ and in the hard exceptions (ten, jeden, mladé, systém) and 41 FLEURS / TrePal test sentences. Scored with theSlovak Whisper `kinit/whisper-large-v3-turbo-sk` (character error rate), Whisper language identification(probability of Slovak) and TorchAudio SQUIM (PESQ estimate):| Voice | CER | P(Slovak) | PESQ ||---|---|---|---|| sk_a | 1.30 % | 0.98 | 3.91 || (v4.0 sk_f3 / sk_f2 / sk_m1, same sentences and frontend) | 1.48 / 1.67 / 1.97 % | 0.99 / 0.99 / 0.98 | 3.71 / 3.78 / 3.26 |Most errors are Whisper writing numbers as digits ("desať" -> 10) and the Indian names of one sentence. The PESQestimate equals that of the speaker's own recordings (3.91). SQUIM works at 16 kHz and does not hear noise above 8 kHz.## Use it```shpip install numpy onnxruntime soundfile huggingface_hub6 unmodified linesfrom tts_slovak import SlovakTTStts = SlovakTTS.from_pretrained(".") # the downloaded folderwav = tts("Dobrý deň, ako sa máte?") # float32 numpy array, 24 kHz (voice "sk_a")tts.save("Vlak odchádza o 7:45 z druhej koľaje.", "vlak.wav")for chunk in tts.stream("Prvá veta. Druhá veta."): # one chunk per sentence...````tts_slovak` runs the ONNX graphs in `web/` with onnxruntime (CPU: 0.8x real time on a MacBook at 10 steps), exactlyas the browser demo does; both were checked against the PyTorch model (same durations, mean mel difference under0.001).**Text frontend** (`tts_slovak/frontend`, pure Python): numbers, dates, times, money and percentages read out withSlovak declension, common abbreviations, grapheme-to-phoneme rules with voicing assimilation across words, stress,sentence types (statement, yes/no question, wh-question, exclamation) and pause levels. New in v5.0: about 360foreign (mostly English) names, places, brands and words respelled as Slovaks say them, with Slovak case endings(Biden -> bajden, Washingtone -> vošingtone); d t n l hard in ten, tento, tie, jeden, vtedy, teda and theadjective endings -é, -ého, -ému, -ej (mladé, celej), and in ~330 loanword stems (systém, problém, partner).**Delivery**: `sk_a` keeps the timing its speaker has (the duration floors and vowel scaling v4.0 used for itssynthetic voices flattened a real voice's rhythm), with short comma pauses, a silent lead-in and a silent sentenceend. It also gets a short j after ť ď ň before e (ťeta -> ť j e t a, the j at 0.7 of its length): its speaker softensthem weakly, and the model learnt that; the setting is `soft_glide` in `web/voices.json`.### PyTorch17 unmodified lines## Known limits- Yes/no questions end with a falling melody, as in most of the training speech (Slovak speakers often rise). Apost-processing lift was built and tried, and left out after listening.- 24 kHz audio. Foreign names outside the list are read with Slovak rules.- Very long sentences without punctuation are read in one piece.## How it was madeThe English base model (v1.0, a 42 M transformer encoder + flow-matching DiT decoder with a duration flow) was taughtSlovak with a shared symbol table (English ids first, then `sk:` phonemes): TrePal (166 speakers, at most 1.5 h each),Lili and FLEURS Slovak, with English replay so English is not forgotten. Each voice was then "locked": 1,800-2,500sentences synthesised in that voice, only takes that the Slovak Whisper transcribed without an error kept, and themodel fine-tuned on them (v4.0). `sk_a`: that model fine-tuned on its speaker's 3 hours of Common Voice recordings (best at 3,000 steps), with BigVGAN fine-tunedon the model's own mels of the voice (4,000 steps). Trained on one RTX 3080.## Data and attribution5 unmodified lines([sarulab-speech/commonvoice22_sidon](https://huggingface.co/datasets/sarulab-speech/commonvoice22_sidon)).- English base model data (HiFi-TTS, DailyTalk and others) and BigVGAN: see[v1.0](https://huggingface.co/mmmhusto/Regulus/tree/v1.0) and [v2.0](https://huggingface.co/mmmhusto/Regulus/tree/v2.0).- Model license: CC BY-SA 4.0 (inherited from DailyTalk in the English base).3 unmodified lines456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081826 unmodified lines899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818917 unmodified lines2072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492505 unmodified lines2562572583 unmodified lines- enlicense: cc-by-sa-4.0pipeline_tag: text-to-speechlibrary_name: onnxtags:- text-to-speech- tts- slovak- slovenčina- english- onnx- onnxruntime- onnxruntime-web- on-device- offline- browser- flow-matchingdatasets:- streams-sro/trepal- vsisik/voice-dataset-lili- google/fleurs- sarulab-speech/commonvoice22_sidon- MikhailT/hifi-tts- eustlb/dailytalk---# Regulus: Slovak and English text-to-speech for your app**Small, open text-to-speech that runs on your own hardware, with no API key, no per-character fees and no audioleaving the device.** Natural Slovak with a full Slovak text frontend, and English with two steady voices.- **Slovak done properly:** numbers, dates, times, money and percentages are read with the right case endings("Dňa 3. mája o 14:30 prišlo 250 ľudí"). Abbreviations, voicing assimilation across words, stress, questions andpauses are handled, and ~360 foreign names are read the way Slovaks say them (Biden, Washingtone, Musk).About **1.3 % character error rate** on unseen sentences.- **English:** two voices (studio audiobook woman, conversational man), a fast CPU mode about 9x faster than realtime, and numbers, money and units written out.- **Runs anywhere:** a 42 M-parameter acoustic model plus a 14 M vocoder, exported to ONNX. It runs with`onnxruntime` on a server or laptop CPU and with `onnxruntime-web` in the browser (WebGPU or WebAssembly). TheSlovak package needs only `numpy`, `onnxruntime` and `soundfile`.- **Streams sentence by sentence**, so playback can start while the rest of a long text is still being generated.- **Open weights** (CC BY-SA 4.0), open code, measured quality, and a demo you can try first.**[Try it in your browser →](https://huggingface.co/spaces/mmmhusto/TTS-English-demo)** (English and Slovak,generated locally on your device).## ListenSlovak, voice `sk_a` (Regulus v5.0, the default settings below):| Text | Audio ||---|---|| Dňa 3. mája o 14:30 prišlo na námestie vyše 250 ľudí. Vstupné stálo 12,50 €, deti mali vstup zadarmo. | <audio controls preload="none" src="https://huggingface.co/mmmhusto/Regulus/resolve/main/samples/sk_a_spravy.wav"></audio> || Starý maják stál na útese už dvesto rokov. Za jasných nocí bolo jeho svetlo vidieť na tridsať kilometrov. ... | <audio controls preload="none" src="https://huggingface.co/mmmhusto/Regulus/resolve/main/samples/sk_a_pribeh.wav"></audio> || Prezident Biden sa vo Washingtone stretol s Elonom Muskom. Teta nám v nedeľu upiekla teplé koláče. | <audio controls preload="none" src="https://huggingface.co/mmmhusto/Regulus/resolve/main/samples/sk_a_mena.wav"></audio> || Prídeš zajtra na obed? Kto ti to povedal? To je skvelá správa! | <audio controls preload="none" src="https://huggingface.co/mmmhusto/Regulus/resolve/main/samples/sk_a_otazky.wav"></audio> |English (Regulus v2.1):| | `en_hifi_92_clean` (default) | `en_dt_0` ||---|---|---|| Reading a story | <audio controls preload="none" src="https://huggingface.co/mmmhusto/Regulus/resolve/v2.1/samples/story_92.wav"></audio> | <audio controls preload="none" src="https://huggingface.co/mmmhusto/Regulus/resolve/v2.1/samples/story_dt0.wav"></audio> || Numbers: "Dr. Smith will see you at 9:30 on March 3rd; the visit costs $45.50 ..." | <audio controls preload="none" src="https://huggingface.co/mmmhusto/Regulus/resolve/v2.1/samples/numbers_92.wav"></audio> | || Fast mode on a CPU (2-step decoder + Vocos) | <audio controls preload="none" src="https://huggingface.co/mmmhusto/Regulus/resolve/v2.1/samples/fast_vocos_story_92.wav"></audio> | |## Which version for your appOne repository, one model line; every release has a tag. Pick the tag for your language:| You need | Use | Voices | Package ||---|---|---|---|| **Slovak** | **`v5.0`** (this page, `main`) | `sk_a`: man, natural reading voice | `tts_slovak` (onnxruntime) || **English** | **`v2.1`** | `en_hifi_92_clean` (woman, studio), `en_dt_0` (man, conversational) | `tts_english` (PyTorch) || English and Slovak in one app | both tags side by side | as above | both packages, ~0.5 GB of files together |## Quick start: Slovak```shpip install numpy onnxruntime soundfile huggingface_hub6 unmodified linesfrom tts_slovak import SlovakTTStts = SlovakTTS.from_pretrained(".") # the downloaded folderwav = tts("Dobrý deň, ako sa máte?") # float32 numpy array, 24 kHz, monotts.save("Vlak odchádza o 7:45 z druhej koľaje.", "vlak.wav")for chunk in tts.stream("Prvá veta. Druhá veta."): # one chunk per sentence: play the first while the rest renders...````SlovakTTS.from_pretrained()` without a path downloads only what the package needs (`web/`, ~110 MB).## Quick start: English```shpip install torch numpy soundfile huggingface_hub safetensors g2p_enpython -c "from g2p_en import G2p; G2p()" # fetches g2p_en's NLTK data once``````pythonfrom huggingface_hub import snapshot_downloadimport sys, soundfile as sfpath = snapshot_download("mmmhusto/Regulus", revision="v2.1")sys.path.insert(0, path)from tts_english import TTS, SAMPLE_RATEtts = TTS.from_pretrained(path, vocoder="vocos", fast=True) # fast on a CPU, nothing else to installwav = tts("Your order has shipped and should arrive on Friday.", voice="en_hifi_92_clean")sf.write("out.wav", wav, SAMPLE_RATE)```For the best English sound use the BigVGAN vocoder (`git clone https://github.com/NVIDIA/BigVGAN`, then`TTS.from_pretrained(path, bigvgan_dir="BigVGAN")`). The [v2.1 page](https://huggingface.co/mmmhusto/Regulus/tree/v2.1)covers styles, long texts, voice cloning and adding your own voice from 5 minutes of speech.## In the browser and on devicesThe Slovak model in `web/` is ready for [onnxruntime-web](https://onnxruntime.ai/docs/tutorials/web/):`text.onnx` (text encoder and durations), `decoder.onnx` (flow-matching decoder), `bigvgan.onnx` (vocoder) and`voices.json` (voice vector, symbol table, delivery settings). The[demo Space](https://huggingface.co/spaces/mmmhusto/TTS-English-demo/tree/main) is a complete, static web app thatruns both languages in the browser. Copy it as a starting point:- `tts.js`: the model on onnxruntime-web (WebGPU, or WebAssembly where WebGPU is missing).- `sk-frontend.js`: the Slovak text frontend, the same Python code as `tts_slovak/frontend`, run with Pyodide.- `app.js`: loading, progress, sentence-by-sentence playback, a lighter path for iPhones.The same ONNX files run in any onnxruntime binding (Python, C/C++, C#, Java, JavaScript, mobile). `tts_slovak/__init__.py`(a few hundred lines of numpy) is the reference for the steps between the graphs.## Quality and speed**Slovak, v5.0:** 105 sentences the model never trained on, read by `tts_slovak` (10 decoder steps). 64 of them aredense in ť ď ň ľ and in words read hard (ten, jeden, mladé, systém); 41 are FLEURS and TrePal test sentences.Scored with the Slovak Whisper `kinit/whisper-large-v3-turbo-sk` (character error rate), Whisper languageidentification and TorchAudio SQUIM (PESQ estimate, 1-4.5):| Voice | Character errors | P(Slovak) | PESQ ||---|---|---|---|| `sk_a` | 1.30 % | 0.98 | 3.91 |Most of these errors are Whisper writing numbers as digits ("desať" -> 10) and the Indian names of one sentence.The PESQ estimate equals that of the speaker's own recordings (3.91). Speed: 1.7 s of computing per second of speechon an Apple M1 Pro CPU (onnxruntime, measured on a busy machine). With streaming, the first sentence plays after itsown time. A GPU (`SlovakTTS(path, providers=["CUDAExecutionProvider"])`) or fewer decoder steps (`steps=4`) gofaster.**English, v2.1:** 64 sentences, word errors by Whisper small.en, speed on an Apple M1 Pro CPU:| Mode | Word errors | PESQ | CPU time / speech time ||---|---|---|---|| full decoder + BigVGAN (best sound) | 1.9 % | 3.87 | 1.73 || fast decoder + Vocos (fastest) | 1.5 % | 2.88 | 0.11 |## The Slovak voice and text frontend| Voice | Sound | Built from ||---|---|---|| `sk_a` | man, natural reading voice | one anonymous Slovak Mozilla Common Voice contributor (3 h, CC0) |`sk_a` is the voice of a real, anonymous person who gave their recordings to Mozilla Common Voice under CC0. Please donot use it to impersonate anyone or to try to identify the speaker, and tell your users that the speech issynthetic. The three synthetic Slovak voices of earlier releases (sk_f3, sk_f2, sk_m1) remain in `v4.0`.**Text frontend** (`tts_slovak/frontend`, pure Python, no dependencies) does the following:- reads numbers, dates, times, money and percentages with Slovak declension;- expands common abbreviations;- converts letters to sounds with voicing assimilation across words, and marks stress;- tells sentence types apart (statement, yes/no question, wh-question, exclamation) and sets pause levels;- respells about 360 foreign (mostly English) names, places, brands and words the way Slovaks say them, with Slovakcase endings (Biden -> bajden, Washingtone -> vošingtone);- keeps d t n l hard where Slovak does: ten, tento, tie, jeden, vtedy, teda, the adjective endings -é, -ého, -ému,-ej (mladé, celej) and ~330 loanword stems (systém, problém, partner).**Delivery:** `sk_a` keeps the timing its speaker has, with short comma pauses, a silent lead-in and a silentsentence end. It also gets a short j after ť ď ň before e (ťeta -> ť j e t a, the j at 0.7 of its length): itsspeaker softens them weakly, and the model learnt that. The setting is `soft_glide` in `web/voices.json`.### PyTorch17 unmodified lines## Known limits- Slovak yes/no questions end with a falling melody, as in most of the training speech (Slovak speakers often rise).- 24 kHz audio. Foreign names outside the list are read with Slovak rules.- Very long sentences without punctuation are read in one piece.- One Slovak voice in v5.0; English and Slovak are separate releases (`v2.1`, `v5.0`).## LicenseThe weights are **CC BY-SA 4.0**, inherited from DailyTalk in the English base model. You may use them, alsocommercially, if you credit "Regulus by mmmhusto" and the datasets below. Models you derive from these weightsmust be shared under the same license. Please read the license text for your own case. The code in `tts_slovak/`comes with the weights under the same terms.## How it was madeThe English base model (v1.0, a 42 M transformer encoder + flow-matching DiT decoder with a duration flow) wastrained from scratch. It then learnt Slovak with a shared symbol table (English ids first, then `sk:` phonemes):- data: TrePal (166 speakers, at most 1.5 h each), Lili and FLEURS Slovak, with English replay so English is notforgotten;- voice locking (v4.0): 1,800-2,500 sentences synthesised per voice, only the takes that the Slovak Whispertranscribed without an error kept, and the model fine-tuned on them;- `sk_a`: that model fine-tuned on its speaker's 3 hours of Common Voice recordings (best at 3,000 steps), withBigVGAN fine-tuned on the model's own mels of the voice (4,000 steps).Everything was trained on one RTX 3080.## All versions| Version | What changed | Download ||---|---|---|| v1.0 | English base model: 590 voices, two speaking styles, fast mode, voice cloning (internal name v2.3) | `hf download mmmhusto/Regulus --revision v1.0` || v2.0 | Fine-tune of v1.0 on two voices: Studio 92 (Cori Samuel) and DailyTalk man | `hf download mmmhusto/Regulus --revision v2.0` || **v2.1** | **English: v2.0 with a fast mode (2-step decoder + Vocos, ~9x real time on a laptop CPU), voice cloning and a measured recipe for adding a voice (5 min of speech)** | `hf download mmmhusto/Regulus --revision v2.1` || v3.0 | First bilingual try: v2.0 plus experimental Slovak (5 voices) | `hf download mmmhusto/Regulus --revision v3.0` || v4.0 | Slovak: three original synthetic voices (sk_f3, sk_f2, sk_m1), about 1 % character error rate | `hf download mmmhusto/Regulus --revision v4.0` || **v5.0** | **Slovak: voice `sk_a`, a real speaker's natural reading voice; foreign names read the way Slovaks say them, ten / jeden / mladé read hard, clearer ť ď ň** | `hf download mmmhusto/Regulus --revision v5.0` |The repository was called TTS-husto (and TTS-English) before; the old names redirect here.## Data and attribution5 unmodified lines([sarulab-speech/commonvoice22_sidon](https://huggingface.co/datasets/sarulab-speech/commonvoice22_sidon)).- English base model data (HiFi-TTS, DailyTalk and others) and BigVGAN: see[v1.0](https://huggingface.co/mmmhusto/Regulus/tree/v1.0) and [v2.0](https://huggingface.co/mmmhusto/Regulus/tree/v2.0).
123version https://git-lfs.github.com/spec/v1oid sha256:c379321bacaec05a570ae0b2d50829bdc78bdc54a1ae76f26366e3702cf7ea9dsize 291884123version https://git-lfs.github.com/spec/v1oid sha256:6eca3051506357594352f172f65907fb926db7252587a7a5153457c4703a0a54size 224204123version https://git-lfs.github.com/spec/v1oid sha256:f861c6303f184e90925c1f9d6f21779b85afbdb9dfa898029902648c345e3b8dsize 473804123version https://git-lfs.github.com/spec/v1oid sha256:7823dda05e582bd543425f60cd91172c6e107e6ce48fc166b05775223c5dbb10size 430124.gitattributes+4
README.md+177-56
samples/sk_a_mena.wavAdded+3
samples/sk_a_otazky.wavAdded+3
samples/sk_a_pribeh.wavAdded+3
samples/sk_a_spravy.wavAdded+3