Transcription using gRPC API
Copy an example audio file from the NIM container to host machine or use your own.
docker cp $CONTAINER_ID:/opt/riva/wav/en-US_sample.wav .
Streaming mode example
Ensure NIM with streaming mode model is deployed.
python3 python-clients/scripts/asr/transcribe_file.py
--server 0.0.0.0:50051 \
--list-models
Input speech file is streamed to the service chunk-by-chunk.
python3 python-clients/scripts/asr/transcribe_file.py \
--server 0.0.0.0:50051 \
--language-code en-US --automatic-punctuation \
--input-file en-US_sample.wav
Offline mode example
Ensure NIM offline mode model is deployed.
python3 python-clients/scripts/asr/transcribe_file_offline.py
--server 0.0.0.0:50051 \
--list-models
Input speech file is sent to the service in one shot.
python3 python-clients/scripts/asr/transcribe_file_offline.py \
--server 0.0.0.0:50051 \
--language-code en-US --automatic-punctuation \
--input-file en-US_sample.wav
Transcription using gRPC API
Copy an example audio file from the NIM container to host machine or use your own.
docker cp $CONTAINER_ID:/opt/riva/wav/es-US_sample.wav .
Streaming mode example
Ensure NIM with streaming mode model is deployed.
python3 python-clients/scripts/asr/transcribe_file.py
--server 0.0.0.0:50051 \
--list-models
. Input speech file is streamed to the service chunk-by-chunk.
python3 python-clients/scripts/asr/transcribe_file.py \
--server 0.0.0.0:50051 \
--language-code es-US --automatic-punctuation \
--input-file es-US_sample.wav
Offline mode example
Ensure NIM with offline mode model is deployed.
python3 python-clients/scripts/asr/transcribe_file_offline.py
--server 0.0.0.0:50051 \
--list-models
Input speech file is sent to the service in one shot.
python3 python-clients/scripts/asr/transcribe_file_offline.py \
--server 0.0.0.0:50051 \
--language-code es-US --automatic-punctuation \
--input-file es-US_sample.wav
Whisper supports transcription in multiple languages. See Supported Languages for the list of all available languages and corresponding code. Specifying input language as multi will enable auto language detection. Specifying correct language is recommended as it will improve accuracy and latency. Whisper model has punctuation enabled by default.
Copy an example audio file from the NIM container to host machine or use your own.
docker cp $CONTAINER_ID:/opt/riva/wav/en-US_sample.wav .
Ensure NIM with Whisper Large v3 model is deployed.
python3 python-clients/scripts/asr/transcribe_file_offline.py
--server 0.0.0.0:50051 \
--list-models
Transcription using gRPC API
Offline mode example. Input speech file is sent to the service in one shot.
python3 python-clients/scripts/asr/transcribe_file_offline.py \
--server 0.0.0.0:50051 \
--language en --input-file en-US_sample.wav
Transcription using HTTP API
curl -s http://0.0.0.0:9000/v1/audio/transcriptions -F language=en \
-F file="@en-US_sample.wav"
Note
Whisper model supports offline mode only.
Whisper supports translation from multiple languages to English language. See Supported Languages for the list of all available languages and corresponding code. Specifying input language as multi will enable auto language detection. Specifying correct input language is recommended as it will improve accuracy and latency
Copy an example audio file from the NIM container to host machine or use your own.
docker cp $CONTAINER_ID:/opt/riva/wav/fr-FR_sample.wav .
Translation to English using gRPC API
python3 python-clients/scripts/asr/transcribe_file_offline.py \
--server 0.0.0.0:50051 \
--language fr --input-file fr-FR_sample.wav \
--custom-configuration task:translate
Translation to English using HTTP API
curl -s http://0.0.0.0:9000/v1/audio/translations -F language=fr \
-F file="@fr-FR_sample.wav"
Note
Whisper model supports offline mode only.
Canary supports transcription in en-US, en-GB, es-ES, ar-AR, es-US, pt-BR, fr-FR, de-DE, it-IT, ja-JP, ko-KR, ru-RU, hi-IN languages. Specifying input language is required. Canary model has punctuation enabled by default.
Copy an example audio file from the NIM container to host machine or use your own.
docker cp $CONTAINER_ID:/opt/riva/wav/en-US_sample.wav .
Ensure NIM with Canary model is deployed.
python3 python-clients/scripts/asr/transcribe_file_offline.py
--server 0.0.0.0:50051 \
--list-models
Transcription using gRPC API
python3 python-clients/scripts/asr/transcribe_file_offline.py \
--server 0.0.0.0:50051 \
--language en-US --input-file en-US_sample.wav
Transcription using HTTP API
curl -s http://0.0.0.0:9000/v1/audio/transcriptions -F language=en-US \
-F file="@en-US_sample.wav"
Note
Canary model supports offline mode only.
Canary supports translation between en-US and es-ES, ar-AR, es-US, pt-BR, fr-FR, de-DE, it-IT, ja-JP, ko-KR, ru-RU, hi-IN languages.
Copy an example audio file from the NIM container to host machine or use your own.
docker cp $CONTAINER_ID:/opt/riva/wav/fr-FR_sample.wav .
docker cp $CONTAINER_ID:/opt/riva/examples/asr_lib/1272-135031-0000.wav .
Translation to English using gRPC API
python3 python-clients/scripts/asr/transcribe_file_offline.py \
--server 0.0.0.0:50051 \
--language fr-FR --input-file fr-FR_sample.wav \
--custom-configuration target_language:en-US,task:translate
Translation to English using HTTP API
curl -s http://0.0.0.0:9000/v1/audio/translations -F language=fr-FR \
-F target_language=en-US -F file="@fr-FR_sample.wav"
Translation from English using gRPC API
python3 python-clients/scripts/asr/transcribe_file_offline.py \
--server 0.0.0.0:50051 \
--language en-US --input-file 1272-135031-0000.wav \
--custom-configuration target_language:fr-FR,task:translate
Translation from English using HTTP API
curl -s http://0.0.0.0:9000/v1/audio/translations -F language=en-US \
-F target_language=fr-FR -F file="@1272-135031-0000.wav"
Note
Canary model supports offline mode only.