#grpc-client #grpc #client #jarvis #riva

nvidia_riva

The rust language implementation of gRPC client for nvidia riva

3 unstable releases

0.2.0 Jul 28, 2023
0.1.2 Jul 28, 2023
0.1.1 Nov 9, 2022
0.1.0 Oct 31, 2022

#57 in #grpc-client

Download history 89/week @ 2024-07-22 81/week @ 2024-07-29 54/week @ 2024-08-05 61/week @ 2024-08-12 70/week @ 2024-08-19 47/week @ 2024-08-26 20/week @ 2024-09-02 38/week @ 2024-09-09 29/week @ 2024-09-16 33/week @ 2024-09-23 51/week @ 2024-09-30 44/week @ 2024-10-07 73/week @ 2024-10-14 102/week @ 2024-10-21 116/week @ 2024-10-28 86/week @ 2024-11-04

378 downloads per month

Apache-2.0 OR MIT

79KB
80 lines

Rust Documentation Crates.io

GRPC Client for Nvidia Riva or Jarvis

How to install

Add nvidia_riva to your dependencies

[dependencies]
# ...
nvidia_riva = 0.2

Getting started

Example for RivaSpeechRecognitionClient

use nvidia_riva::asr::riva_speech_recognition_client::RivaSpeechRecognitionClient;
use nvidia_riva::asr::{RecognitionConfig, RecognizeRequest};
use nvidia_riva::AudioEncoding;

#[tokio::main]
async fn main() -> Result<(), anyhow::Error> {
    let mut riva_client =
        RivaSpeechRecognitionClient::connect("http://127.0.0.1:50051").await?;

    let bytes = std::fs::read("./assets/data/test.wav")
        .expect("Unable read `test.wav` file");
    let riva_request = RecognizeRequest {
        config: Some(RecognitionConfig {
            encoding: AudioEncoding::LinearPcm as i32,
            sample_rate_hertz: 16000,
            language_code: String::from("en-US"),
            max_alternatives: 1,
            profanity_filter: false,
            speech_contexts: vec![],
            audio_channel_count: 1,
            enable_word_time_offsets: false,
            enable_automatic_punctuation: false,
            enable_separate_recognition_per_channel: false,
            model: "riva-asr".to_string(),
            verbatim_transcripts: true,
            custom_configuration: Default::default(),
        }),
        audio: bytes,
    };
    let riva_result = riva_client.recognize(riva_request).await;
    println!("{:?}", riva_result);
    Ok(())
}

Dependencies

~5–12MB
~123K SLoC