This image runs the SpeechT5 model for text-to-speech task.
This image exposes a POST API that you can use to send your text and it will be converted into a numpy array representing the corresponing audio. Once the array is generated, in order to "listen" it, it must be sent to a service capable of producing audio from the array: you can use this docker image (see instructions).
Container exposed port: 1000
Endpoint url: "/tts"
Choose a folder to put in:
Below is an example of docker-compose.yml file: it starts a multi-container application capable of generating audio from a written text:
version: '3'
networks:
text-to-speech:
driver: bridge
services:
container_audio:
image: alessio21/play-numpy-array
ports:
- "2865:2865"
networks:
- text-to-speech
container_tts:
image: alessio21/text-to-speech
ports:
- "1000:1000"
volumes:
- ./tts_models:/app/models
- ./speaker_embedding:/app/speaker_embedding
environment:
- SPEAKER=slt
- API_URL=http://container_audio:2865/send_array
networks:
- text-to-speech
Send your text to be converted in audio:
import requests
API_URL = "http://localhost:1000/tts"
prompt = "Hi! Who are you? I am your AI assistant"
payload = {"text":prompt}
resp = requests.post(API_URL, json=payload)
response resp.json()
print(response)
In this repository the image is used to generate audio for a voice chatbot (see the docker-compose.yml file).
Content type
Image
Digest
sha256:464aa2986…
Size
544.6 MB
Last updated
over 2 years ago
docker pull alessio21/text-to-speech