# Riva Python Client isn't producing the proper streaming output for ASRs

**URL:** <https://forums.developer.nvidia.com/t/riva-python-client-isnt-producing-the-proper-streaming-output-for-asrs/241940>\
**Category:** Nemotron Speech + Riva\
**Created:** [February 7, 2023, 10:59am UTC](https://forums.developer.nvidia.com/t/riva-python-client-isnt-producing-the-proper-streaming-output-for-asrs/241940 "2023-02-07T10:59:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sheikh.asif.imran](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/sheikh.asif.imran/32/226021_2.png) [@sheikh.asif.imran](https://forums.developer.nvidia.com/u/sheikh.asif.imran)\
**Post date:** [February 7, 2023, 10:59am UTC](https://forums.developer.nvidia.com/t/riva-python-client-isnt-producing-the-proper-streaming-output-for-asrs/241940/1 "2023-02-07T10:59:46Z")

</div>

I’ve followed the Riva quickstart guide to deploy the default English ASR model. When I use the CLI, Riva produces the correct results for streaming. However, when I use the following script, the results are incomplete and the final result is empty. Please let me know what could be wrong here.

```auto
import riva.client

from copy import deepcopy

uri = "localhost:50051"

auth = riva.client.Auth(uri=uri)

asr_service = riva.client.ASRService(auth)

offline_config = riva.client.RecognitionConfig(language_code="en-US",encoding=riva.client.AudioEncoding.LINEAR_PCM)
streaming_config = riva.client.StreamingRecognitionConfig(config=deepcopy(offline_config), interim_results=True)

def interpret(consumed_message_value):
    audio_file_path="/opt/riva/wav/en-US_sample.wav"
    error_msg=""

    if error_msg:
        print(error_msg)
        return

    riva.client.add_audio_file_specs_to_config(streaming_config, audio_file_path)
    
    wav_parameters = riva.client.get_wav_file_parameters(audio_file_path)
    # correponds to 1 second of audio
    chunk_size = wav_parameters['framerate']

    audio_chunk_iterator = riva.client.AudioChunkFileIterator(audio_file_path, chunk_size)
    response_generator = asr_service.streaming_response_generator(audio_chunk_iterator, streaming_config)

    riva.client.print_streaming(response_generator, additional_info='confidence')

interpret(consumed_message_value={})

```

The output is:

```auto
>> what
Stability: 0.1000
----
>> what
Stability: 0.1000
----
>> what is
Stability: 0.1000
----
>> what is
Stability: 0.1000
----
>> what is
Stability: 0.1000
----
>> what is now
Stability: 0.1000
----
>> what is natural
Stability: 0.1000
----
>> what is natural
Stability: 0.1000
----
>> what is natural language
Stability: 0.1000
----
>> what is natural language
Stability: 0.1000
----
>> what is natural language
Stability: 0.1000
----
>> what is natural language
Stability: 0.1000
----
>> what 
Stability: 0.9000
>> is natural language Processing
Stability: 0.1000
----
>> what 
Stability: 0.9000
>> is natural language Processing
Stability: 0.1000
----
>> what is 
Stability: 0.9000
>> natural language Processing
Stability: 0.1000
----
>> what is 
Stability: 0.9000
>> natural language Processing
Stability: 0.1000
----
>> what is 
Stability: 0.9000
>> natural language Processing
Stability: 0.1000
----
>> what is 
Stability: 0.9000
>> language Processing
Stability: 0.1000
----
>> what is 
Stability: 0.9000
>> language Processing
Stability: 0.1000
----
----

```

Expected output should contain the following line according to my understanding:

```auto
## What is Natural Language Processing? 
Confidence: <some floating value>

```

---

<div class="post-metadata">

**Author:** ![rvinobha](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/rvinobha/32/14047_2.png) [@rvinobha](https://forums.developer.nvidia.com/u/rvinobha)\
**Post date:** [February 14, 2023, 12:54pm UTC](https://forums.developer.nvidia.com/t/riva-python-client-isnt-producing-the-proper-streaming-output-for-asrs/241940/2 "2023-02-14T12:54:54Z")

</div>

Hi @sheikh.asif.imran

Thanks for your interest in Riva

Apologies for the delay, let me try to repro the same from my end, check and update you soon

Thanks
