nvidia

magpie-tts-multilingual

Run Anywhere

Natural and expressive voices in multiple languages. For voice agents and brand ambassadors.

Deploying your application in production? Get started with a 90-day evaluation of NVIDIA AI Enterprise

Follow the steps below to download and run the NVIDIA NIM inference microservice for this model on your infrastructure of choice.

Generate API Key

Pull and Run the NIM

$ docker login nvcr.io Username: $oauthtoken Password: <PASTE_API_KEY_HERE>

Refer Supported Models for full list of models.

export NGC_API_KEY=<PASTE_API_KEY_HERE> docker run -it --rm --name=magpie-tts-multilingual \ --runtime=nvidia \ --gpus '"device=0"' \ --shm-size=8GB \ -e NGC_API_KEY=$NGC_API_KEY \ -e NIM_HTTP_API_PORT=9000 \ -e NIM_GRPC_API_PORT=50051 \ -p 9000:9000 \ -p 50051:50051 \ nvcr.io/nim/nvidia/magpie-tts-multilingual:latest

It may take a up to 30 minutes depending on your network speed, for the container to be ready and start accepting requests from the time the docker container is started.

Open a new terminal and run following command to check if the service is ready to handle inference requests

curl -X 'GET' 'http://localhost:9000/v1/health/ready'

If the service is ready, you get a response similar to the following.

{"ready":true}

Test the NIM

Open a new terminal and run following commands to synthesize audio from text using sample client scripts.

Install the Riva Python client package

sudo apt-get install python3-pip pip install -U nvidia-riva-client

Download Riva sample clients

git clone https://github.com/nvidia-riva/python-clients.git

Run Text to Speech inference in English (en-US)

python3 python-clients/scripts/tts/talk.py --server 0.0.0.0:50051 \ --language-code en-US \ --voice Magpie-Multilingual.EN-US.Sofia \ --text "Hello, this is a speech synthesizer." \ --output output_english.wav

Run Text to Speech inference in Spanish (es-US)

python3 python-clients/scripts/tts/talk.py --server 0.0.0.0:50051 \ --language-code es-US \ --voice Magpie-Multilingual.ES-US.Diego \ --text "Vamos al parque los domingos para jugar con nuestros amigos." \ --output output_spanish.wav

Run Text to Speech inference in French (fr-FR)

python3 python-clients/scripts/tts/talk.py --server 0.0.0.0:50051 \ --language-code fr-FR \ --voice Magpie-Multilingual.FR-FR.Louise \ --text "Je vais au supermarché avec ma mère pour acheter des légumes." \ --output output_french.wav

On running the above commands, the synthesized audio will be saved to files with corresponding names.

You can list available voices with following command.

python3 python-clients/scripts/tts/talk.py --server 0.0.0.0:50051 \ --list-voices

For more details on getting started with this NIM, visit the Riva TTS NIM Docs.