pitput

pitput (ืคึดึผื˜ึฐืคึผื•ึผื˜) is a Hebrew take on tiny-voca: a tiny TTS model built to run on a CPU. The whole model, vocoder included, is only 20 MB (5.0M parameters). It outputs 24 kHz mono and runs faster than real time on a laptop CPU. It reads plain Hebrew without niqqud, in one voice with 8 delivery styles and 8 expression tags (<laugh>, <sigh>, <short pause> โ€ฆ).

It is a personal learning project, trained from scratch on synthetic speech. Try it in the browser on the Space.

Samples

The listening texts, synthesized with the default settings (the model's own playback: word codes at 0.5, melody at 0.3, pitch range 1.2, seed 0).

Style Text Audio
default ืœืคื™ ื ืชื•ื ื™ ื”ืœืฉื›ื” ื”ืžืจื›ื–ื™ืช ืœืกื˜ื˜ื™ืกื˜ื™ืงื”, ืื•ื›ืœื•ืกื™ื™ืช ื™ืฉืจืืœ ื’ื“ืœื” ื‘ืฉื ื” ื”ืื—ืจื•ื ื” ื‘ื›ืžืื” ื•ืฉืžื•ื ื™ื ืืœืฃ ืื™ืฉ.
default, addressee f ืžื” ืฉืœื•ืžืš? ืฉืžืขืชื™ ืฉืœื ื”ืจื’ืฉืช ื˜ื•ื‘ ื‘ืฉื‘ื•ืข ืฉืขื‘ืจ.
default ื”ืจื›ื‘ืช ืœื—ื™ืคื” ื™ื•ืฆืืช ื‘ืฉื‘ืข ื•ืขืฉืจื™ื ื•ืžื’ื™ืขื” ื‘ืฉืžื•ื ื” ื•ื—ืฆื™, <chuckle> ืื ื”ื™ื ื‘ื›ืœืœ ืชื’ื™ืข.
excited <laugh> ืื ื™ ืœื ืžืืžื™ื ื”, ืงื™ื‘ืœื ื• ืืช ื”ื“ื™ืจื”!
sad <sigh> ื—ื™ื›ื™ืชื™ ืœื• ื›ืœ ื”ืขืจื‘, ื•ื”ื•ื ืคืฉื•ื˜ ืœื ื”ื’ื™ืข.
angry, addressee m ื›ืžื” ืคืขืžื™ื ืืžืจืชื™ ืœืš ืœืกื’ื•ืจ ืืช ื”ื“ืœืช?!
fearful ืฉืžืขืช ืืช ื–ื”? <gasp> ื™ืฉ ืžื™ืฉื”ื• ื‘ื—ื•ืฅ.
surprised ืจื’ืข, <short pause> ื”ื•ื ื‘ืืžืช ื”ืชืคื˜ืจ? ืื—ืจื™ ืขืฉืจื™ื ืฉื ื”?
calm <breath> ืงื—ื• ื ืฉื™ืžื” ืขืžื•ืงื”, <long pause> ื•ืชื ื• ืœื’ื•ืฃ ืœื”ื™ืจื’ืข ืœืื˜ ืœืื˜.
whisper ื‘ื•ื ื ื“ื‘ืจ ื‘ืฉืงื˜, ื›ื•ืœื ื›ื‘ืจ ื™ืฉื ื™ื.

Usage

git clone https://huggingface.co/useless-ai/pitput
cd pitput
pip install -r requirements.txt        # PyTorch, numpy, soundfile

python -m pitput.infer --style excited --text "<laugh> ืื ื™ ืœื ืžืืžื™ื ื”, ืงื™ื‘ืœื ื• ืืช ื”ื“ื™ืจื”!" --output out.wav
python -m pitput.infer --style default --addressee f --text "ืžื” ืฉืœื•ืžืš? ืฉืžืขืชื™ ืฉืœื ื”ืจื’ืฉืช ื˜ื•ื‘." --output hello.wav

The phonemizer (about 40 MB) is included. Options:

Option Meaning
--style default, excited, sad, angry, fearful, surprised, calm, whisper
--addressee m / f Gender of the person spoken to (ืœืš, ืื•ืชืš, ืืžืจืช โ€ฆ). Without it, the sentence decides: a name, a form of address or the story is enough
--temperature How freely the delivery is drawn. Omitted, the model uses its own playback (word codes at 0.5, melody at 0.3). 0 is the most likely delivery; higher is livelier and less predictable; above ~1 it starts to break up
--seed Another seed gives another delivery of the same text (default 0). If a laugh or chuckle comes out weak, try another seed
--text-file Read the text from a UTF-8 file instead of --text
--speed 1.0 = as trained; 0.9 is 10% slower
--pitch-shift Added to log F0 (0.058 โ‰ˆ one semitone)
--pitch-range Scales the melody around each sentence's mean pitch (default: the model's own, 1.2)
--device cpu (default) or cuda

From Python:

import soundfile as sf
from pitput.infer import CHECKPOINT, load_model, speak_text

model = load_model(CHECKPOINT)  # inference.pt next to the package
wave, utterances = speak_text(model, "ืฉืœื•ื, <sigh> ืžื” ืฉืœื•ืžืš?", "calm", addressee="f", seed=0)
sf.write("out.wav", wave.numpy(), model.config.sample_rate)

Passing temperature=0.55 plays the way v2 did, with one temperature for both the word codes and the melody.

What the input must look like

  • Plain Hebrew in spoken form. There is no text normalizer for dates and acronyms: write those out in Hebrew words (ื‘ืฉื‘ืข ื•ืขืฉืจื™ื, not 7:20). A digit string is read as a number. Characters it can't read are skipped.
  • No niqqud needed. The phonemizer reads each sentence in context and adds stress. A pointed letter is followed; an unpointed letter is still predicted from the sentence.
  • Tags go where the sound should be, in English inside the Hebrew: <laugh>, <chuckle>, <sigh>, <breath>, <gasp>, <throat-clearing>, <short pause>, <long pause>.
  • Fillers ืื”ืž and ืืžืž are read "emm", ื”ืžืž as a hum, ืื”ื” as a long "a".
  • Punctuation shapes the delivery (, . ? ! โ€ฆ). Long texts are read sentence by sentence.
  • The voice is a woman's, including first person (ื‘ื•ื“ืงืช, not ื‘ื•ื“ืง).

Model

A fork of fiato, itself a fork of tiny-voca: a FastSpeech2-style model with a built-in differentiable source-filter vocoder, so there is no separate neural vocoder.

  • Input: 47 tokens: 29 phonemes, 5 punctuation marks, word boundary, utterance edges and the 8 expression tags. Stress is a parallel feature, not a token.
  • Text encoder: 4 transformer layers, 192 channels, with the style embedding added to every token.
  • Word delivery codes: each word or tag gets one of 32 learned delivery codes, chosen by a small recurrent planner from the text, the style and the previous codes. A sound tag's code comes from a table of the codes that gave full, audible renderings of that tag.
  • Timing: a token-level flow (flow matching, 2 layers) draws every token's length and whether a pause follows it, for the whole sentence at once.
  • Frame level: the style embedding is added again; a frame-level flow (2 layers) draws the pitch, voicing and energy contour, and 5 transformer layers predict the acoustic features.
  • Vocoder: a harmonic pulse train, on voiced frames only, plus noise shaped by 64 cepstral coefficients per frame.
  • Size: 4,991,888 parameters at inference (20 MB checkpoint); the weights are a moving average over training. Training also uses parameters that are not in the checkpoint (discriminators, a reference encoder for the delivery codes, an auxiliary mel head).

Training data

The dataset is synthetic only, with no recorded human speech: about 91,600 clips (180 h) of one synthetic voice, of which 86,438 training clips (173 h) passed forced alignment. 160 held-out sentences (20 per style) were kept for validation and 160 for test.

  • Text: Hebrew sentences from news (archive, HeSum, RSS), HeDC4 web text and stories, Hebrew Wikipedia, ivrit.ai transcripts and LLM-written scenes, among them emotional, dialogue-heavy scenes written for the expressive styles and sounds, plus short lines with hesitation fillers.

  • Spoken form: an LLM rewrote numbers, dates, money, acronyms and Latin script as Hebrew words, and every answer was checked by code.

  • Addressee gender: an LLM decided the gender of ambiguous second-person words (ืœืš, ืื•ืชืš, ืืžืจืช) in context. The audio follows that decision. Where the decided words of a sentence agree, the phonemes use that listener; otherwise the phonemizer decides from the sentence.

  • Styles: an LLM picked a style for each dialogue sentence and inserted the tags; calm and whisper were assigned to plain statements, and some expressive sentences were recorded in a second style. Each style was rendered with one fixed delivery instruction; default is a bright, friendly delivery.

    Style Aligned training clips
    default 54,318
    calm 5,438
    whisper 4,867
    surprised 4,638
    angry 4,556
    excited 4,533
    sad 4,120
    fearful 3,968

    Tags in the aligned clips (at most 2 per clip): breath 4,008, short pause 3,277, long pause 2,704, chuckle 2,236, laugh 2,161, gasp 2,103, sigh 2,005, throat-clearing 1,101.

  • Labels: phonemes from the phonemizer in this repository, with stress and the tags at their positions. Durations come from forced alignment with facebook/wav2vec2-lv-60-espeak-cv-ft, which is used only for labeling and is not part of the model. A tag owns the sound up to the neighbouring phonemes.

Limitations

  • Laughs and chuckles vary. Some draws are full and some are thin; another --seed usually helps. <breath> and <sigh> are quieter than speech, as they are in the data.
  • Melody and emphasis: the melody is less varied than the recordings, and the emphasis of a sentence sometimes lands on the wrong word. A tag does not reliably change the tone of the words after it.
  • Temperature trades life for stability: the default playback is the steadier one. Above ~1, words can be mispronounced and the sound can break.
  • Fearful is the weakest style: more of its clips failed alignment than the other styles.
  • Pronunciation follows the bundled phonemizer. ื‘ื™ืŸ and ื‘ื™ืช are read with ej (bหˆejn, bหˆejt). With no listener and no cue in the sentence, "ืจืื™ืช ืืช ื”ืกืจื˜ ื”ื—ื“ืฉ, ืžื™ื›ืœ?" is read as masculine; --addressee f fixes it.
  • The speaker is a woman. First person follows that (ื‘ื•ื“ืงืช). There is no men's voice.
  • One voice only. Sentences are synthesized independently, with no prosody carried between them.

License

  • Code (pitput/): Apache License 2.0. It is a fork of fiato by cfahlgren1 and tiny-voca by Muhammed Nazeem, both Apache-2.0; see NOTICE, LICENSE and LICENSE.tiny-voca.
  • Phonemizer (phonemizer/, code and weights): Apache License 2.0. renikud_onnx.py is from RenikudPlus by notmax123, Apache-2.0; see phonemizer/NOTICE.
  • TTS weights and audio samples are not licensed for redistribution or any commercial use.

Files

File Contents
inference.pt Weights, model configuration and front-end fingerprint (loaded with weights_only=True)
pitput/ Inference code: infer.py (command line and speak_text), model.py, text.py (phoneme tokens), read.py (Hebrew to a label)
phonemizer/ The pronunciation model: phonemizer.py, model.safetensors (40 MB), config.json
samples/ The audio above
config.json, recipe.json Model and training settings of this version
requirements.txt Python dependencies
NOTICE, LICENSE, LICENSE.tiny-voca Attribution and license of the code

Acknowledgements

tiny-voca for the architecture and training recipe, fiato for expression tags on it, RenikudPlus for the phonemizer's per-letter distributions, decoder and number reading, and the Hebrew text sources: HeDC4, HeSum, Hebrew Wikipedia and ivrit.ai.

Downloads last month
149
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support