python tritonclient stream_infer should send end signal to callback
See original GitHub issuethis maybe a new baby question, I think we should add self._callback(result=None, error=None)
after finish iteration on responses
to let callback know stream response is complete and no more response will be sended. Am I right?
python triton client code
def _process_response(self, responses):
"""Worker thread function to iterate through the response stream and
executes the provided callbacks.
Parameters
----------
responses : iterator
The iterator to the response from the server for the
requests in the stream.
"""
try:
for response in responses:
if self._verbose:
print(response)
result = error = None
if response.error_message != "":
error = InferenceServerException(msg=response.error_message)
else:
result = InferResult(response.infer_response)
self._callback(result=result, error=error)
############ add here ##############
self._callback(result=None, error=None) # new code
except grpc.RpcError as rpc_error:
error = get_error_grpc(rpc_error)
self._callback(result=None, error=error)
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Integrating NVIDIA Triton Inference Server with Kaldi ASR
4), a client connects to the gRPC server, streams audio by sending chunks to the server, and gets back the inferred text as...
Read more >tritonclient - PyPI
Python client library and utilities for communicating with Triton Inference Server.
Read more >gRPC AsyncIO API — gRPC Python 1.46.2 documentation
Finishes the asynchronous context manager by closing the channel. Still active RPCs will be cancelled. abstract async channel_ready() ...
Read more >Message 331645 - Python tracker
The callback will be invoked in the thread that runs the event loop, along with other queued callbacks and runnable coroutines. Unlike signal...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Jackiexiao This sounds like a reasonable request to me. I think we should deliver the flag to the client indicating whether this is the last response or not. Right now, it looks like the client must know before hand the number of responses that the model is going to send. @tanmayv25 / @jbkyang-nvi What do you think?
Not yet. It’s in our queue.