
Riva uses gRPC APIs. Instructions below demonstrate usage of riva-translate-1_6b model using Python gRPC client.
You will need a system with Git and Python 3+ installed.
pip install nvidia-riva-client
Download Python client code by cloning Python Client Repository.
git clone https://github.com/nvidia-riva/python-clients.git
Open a command terminal and execute below command to translate text. If you have generated the API key, it will be auto-populated in the command.
python python-clients/scripts/nmt/nmt.py \
--server grpc.nvcf.nvidia.com:443 --use-ssl \
--metadata function-id "0778f2eb-b64d-45e7-acae-7dd9b9b35b4d" \
--metadata "authorization" "Bearer $NVIDIA_API_KEY" \
--text "This is an example text for Riva text translation" \
--source-language-code en \
--target-language-code de
List of supported source and target languages can be queried using below command.
python python-clients/scripts/nmt/nmt.py \
--server grpc.nvcf.nvidia.com:443 --use-ssl \
--metadata function-id "0778f2eb-b64d-45e7-acae-7dd9b9b35b4d" \
--metadata "authorization" "Bearer $NVIDIA_API_KEY" \
--list-models
Riva uses gRPC APIs. Proto files can be downloaded from Riva gRPC Proto files and compiled to target language using Protoc compiler. Example Riva clients in C++ and Python languages are provided below.