Service Setup
The service requires the following:
zookeeper and kafka
postgresql
minio for storage and file access
the zeroth master service
the tts-api service
the TTS worker service
the TTS encoder service
all of the above are available as docker images, either publicly (zookeeper, kafka, minio) or from Atlas Labs.
models are also needed. they should be provided from Atlas Labs and extracted to host machine.
the following assumes a working setup of master, minio, postgresql and kafka + zookeeper (already in GitBook Manual), and shows how to add the tts-specific components. the services will be launched by docker-compose.
Encoder Compose Sample
this docker-compose snippet will launch one encoder instance on GPU:0 . please check the latest image version.
version: '2.3'
services:
encoder0:
image: 161969600347.dkr.ecr.ap-northeast-2.amazonaws.com/zeroth/tts/encoder:0.2.2
runtime: nvidia
restart: always
environment:
CUDA_LAUNCH_BLOCKING: 0
OMP_NUM_THREAD: 4
NVIDIA_VISIBLE_DEVICES: 0
ENCODER_NUM_WORKERS: 100
ENCODER_SOCKET_PORT: 7878
ENCODER_USE_MODEL: 16khz
ENCODER_RESAMPLER: none
volumes:
- <local/path/to/extracted/models>:/workspace/server/model
- <local/path/to/logs>/tts-encoder:/workspace/server/logs/encodertake note of the following settings:
versionis set to 2.3 for compatibility withnvidia-docker2runtimeis specified as nvidia to allow for GPU inferenceNVIDIA_VISIBLE_DEVICESspecifies which GPU to use on the local machine.ENCODER_NUM_WORKERSmust match or exceed the worker'sNUMWORKERSENCODER_SOCKET_PORTmust match the worker'sWORKER_SOCKET_PORTENCODER_USE_MODELrefers to the model set to use. this is a subdirectory within the mounted model directoryENCODER_RESAMPLERdetermines which resampling to do in the encoder. with a gstreamer-enabled worker, set to none.volumes:mount the model base directory to the container's/workspace/server/modeldirectory. this directory should contain a subdirectory corresponding to theENCODER_USE_MODELparameter.volumes:mount a local directory to the container's/workspace/server/logs/encoderdirectory to access logs locally.
see the "Container Configuration" section below for a full list of configuration environment variables.
Worker Compose Sample
take note of the following settings:
WORKER_MASTER_ENDPOINTshould contain a comma-separated list of master endpointsWORKER_SOCKET_ADDRshould be service name of correspondingencoder(for use with docker networking).WORKER_SOCKET_PORTshould be port of correspondingencoder. (see encoderENCODER_SOCKET_PORT)NUMWORKERSmust be less than or equal to the encoder'sENCODER_NUM_WORKERSvolumes:mount container's/home/root/zeroth-tts-worker/log/ttsto local to access worker log files.
see the "Container Configuration" section below for a full list of configuration environment variables.
Mult-GPU setups
for multi-GPU machines, it is recommended to initiate an encoder and worker container for each GPU.
for each encoder container:
set container name to unique name, (e.g. encoder0, encoder1, encoder2, ...)
set
NVIDIA_VISIBLE_DEVICESto a unique GPU index (e.g. 0, 1, 2, ...)set
ENCODER_SOCKET_PORTto a unique port (e.g. 7878, 7879, 7880, ...)
for each worker container:
set container name to unique name, (e.g. worker0, worker1, worker2, ...)
set
WORKER_SOCKET_PORTto port of corresponding encoder (e.g. 7878, 7879, 7880, ...)set
depends_onto corresponding encoder name (e.g. encoder0, encoder1, encoder2, ...)
TTS API Compose Sample
the output format is specified by:
AUDIO_ENCODING: the sox command used to process the PCM stream; notice default sample rate is16000and encoding ismp3AUDIO_EXTENSION: determines the file extension of the saved file
Last updated
Was this helpful?