Enable smooth global interactions in 32 languages.
Riva uses gRPC APIs. Instructions below demonstrate usage of megatron-1b-nmt model using Python gRPC client.
You will need a system with Git and Python 3+ installed.
$ pip install -r https://raw.githubusercontent.com/nvidia-riva/python-clients/main/requirements.txt $ pip install --force-reinstall git+https://github.com/nvidia-riva/python-clients.git
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 "647147c1-9c23-496c-8304-2e29e7574510" \ --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 "647147c1-9c23-496c-8304-2e29e7574510" \ --metadata "authorization" "Bearer $API_KEY_REQUIRED_IF_EXECUTING_OUTSIDE_NGC" \ --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.