- The TTS Dojo is a set of shell scripts that use Piper TTS to produce custom text-to-speech models, either by finetuning pretrained Piper TTS checkpoint files or training models from scratch.
- Piper's training services are provided via a docker container called
textymcspeechy-piper, which can either be downloaded from dockerhub or built locally. - Voice dojos automatically start the
textymcspeechy-piperdocker image by callingTextyMcSpeechy/run_container.shand automatically stop it when training ends. - If you have set up custom pronunciation rules in
tts_dojo/ESPEAK_RULES, these can be configured to be activated automatically when your container runs. A guide can be found here
- The quick start guide contains everything you need to know about getting your first training session running
- Be aware the provided training scripts delete all data stored in
<VOICE_NAME>_dojo/training_folder/lightning_logsat the beginning of each training run. - When training starts, the training scripts run in a multi-window environment provided by
tmux. The tmux session is namedtraining. - The training session can be shut down from any terminal window with the command
tmux kill-sessionif there is a problem and the normal ways of shutting the session down are unavailable. - If your training session crashes you may need to manually bring down the
textymcspeechy-piperdocker image. Check its status by runningdocker ps - You can shut the docker container down manually by either:
- navigating to the main
TextyMcSpeechyfolder and running./stop_container.sh - running
docker stop textymcspeechy-piperfrom any terminal window.
- navigating to the main
- The layout of the training panes isn't always ideal the first time you run a training session. You can drag the boundaries between panes around with your mouse to adjust them to your liking. The layout can be saved by clicking on the "CONTROL CONSOLE" pane and pressing
t. This layout will be applied automatically on future training runs.
-
PIPER TRAINING RAW OUTPUTThis pane contains all of the text generated by piper as it trains your model. I generally recommend making this pane 2 rows tall since most of the information provided here isn't very useful. There are often many warnings that appear in this pane. Most of them can be ignored.- The best indicator that your training session is working properly is when
rank_zero_warn (appears at the bottom of this pane. It is normal for this to appear for several minutes as training is initializing. - You may see a warning about a low number of workers being a bottleneck. Currently the only way to resolve this is to modify piper's source code.
- If you see an error related to
zipfiles here, this usually means your starting checkpoint file is corrupted. Either restart training or delete the highest epoch checkpoint in thevoice_checkpointsdirectory.
- The best indicator that your training session is working properly is when
-
TENSORBOARD SERVERThis pane runs a web server that lets you view graphs related to training progress. Open http://localhost:6006 in your web browser if you want to see them. When the graph forloss_disc_alllevels off, your model is probably almost ready. It isn't necessary to use this at all during training but I provide it for those who prefer a more quantitative approach than "listening to a model and seeing if it sounds good" (my preferred method). -
TTS MODEL EXPORTERThis pane contains piper's output when it converts a checkpoint file into a.onnxfile. It can be reduced to a single row high since it produces almost no output during normal operation. -
- The
CHECKPOINT GRABBERpane runs a script which allows you to periodically save one of the checkpoint files that Piper generates during training and automatically convert it into a text-to-speech model. - This allows you to decide when your model is done training by listening to which checkpoint's version of the voice sounds the best.
- Beware that leaving this tool unattended for a long time or saving checkpoint files frequently could quite easily fill your entire hard drive -- each checkpoint file is over 800MB.
- You can set up an automatic shutdown if your available storage falls below a certain threshold by editing the global SETTINGS.txt file in
tts_dojo/DOJO_CONTENTS/scripts/SETTINGS.txtbefore creating a new voice dojo. - You can manually save the most recent checkpoint file and convert it to a Piper voice model by pressing
swhile this pane is selected. This can be useful if you need to shut down a training session and resume it later.run_training.shwill automatically prompt you to resume training from the highest epoch checkpoint you have saved. - Since checkpoint files are so large, by default the checkpoint grabber only saves 1 out of every 25 checkpoints that piper generates. You can change how often checkpoints are automatically saved by pressing
ito save them less often and anddto save them more often. You can also turn automatic saving off and on by pressingt.
- The
-
- This pane displays information about the amount of storage your training session is using, and also provides several controls when it is selected. Select the
CONTROL CONSOLEpane by clicking it (or navigating to it with<CTRL>-Bfollowed by arrow keys) if you don't have a mouse, then: - To shut down training: press
q. - To save the current tmux window layout: press
t - To restore a previous tmux window layout: press
r
- This pane displays information about the amount of storage your training session is using, and also provides several controls when it is selected. Select the
-
- This pane allows you to hear what the voice associated with a saved checkpoint file sounds like.
- After at least one checkpoint has been saved and exported, a list of voice files will appear in this window.
- Select this window and use the arrow keys to highlight the version of the voice you want to hear, then press
sto have it speak the text in the"Text to say:"field. - The number following the underscore is the epoch number of the corresponding checkpoint file saved in
<VOICE_NAME_dojo>/voice_checkpoints - Any voice that appears in the voice tester pane is ready to be used in your Piper projects.
- Your finished Piper voices are stored in subfolders of
<VOICE_NAME_dojo>/tts_voices - A Piper voice consists of both an
.onnxfile and a.onnx.jsonfile - Note: the latest version of the TTS dojo scripts name the voice files according to Piper's expected naming conventions. Voices trained with earlier versions of TextyMcSpeechy or voices that have been manually renamed may need to be modified using this guide in order to make them work properly with apps such as
Home Assistant.



