File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import itertools
22import time
3- from typing import Iterator , Optional , Union
3+ from typing import Iterable , Iterator , Optional , Union
44
55from clarifai_grpc .grpc .api import service_pb2
66from clarifai_grpc .grpc .api .status import status_code_pb2 , status_pb2
@@ -278,7 +278,7 @@ def runner_item_generate(
278278 logger .info (f"{ endpoint } | { status_str } | { duration_ms :.2f} ms | req_id={ req_id } " )
279279
280280 def runner_item_stream (
281- self , runner_item_iterator : Iterator [service_pb2 .RunnerItem ]
281+ self , runner_item_iterator : Iterable [service_pb2 .RunnerItem ]
282282 ) -> Iterator [service_pb2 .RunnerItemOutput ]:
283283 # Call the generate() method the underlying model implements.
284284 start_time = time .time ()
@@ -335,7 +335,7 @@ def runner_item_stream(
335335 resp .status .description = "Mixed Status"
336336 status_str = STATUS_MIXED
337337 else :
338- resp .status .code = status_code_pb2 .FAILURE
338+ resp .status .code = status_code_pb2 .RUNNER_PROCESSING_FAILED
339339 resp .status .description = "Failed"
340340 status_str = STATUS_FAIL
341341
You can’t perform that action at this time.
0 commit comments