
Getting Started
Riva uses gRPC APIs. Instructions below demonstrate usage of riva-translate-1_6b model using Python gRPC client.
Prerequisites
You will need a system with Git and Python 3+ installed.
Install Riva Python Client
pip install nvidia-riva-client
Download Python Client
Download Python client code by cloning Python Client Repository.
git clone https://github.com/nvidia-riva/python-clients.git
Run Python Client
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 $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC" \ --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 $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC" \ --list-models
Support for gRPC clients in other languages
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.