File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -248,6 +248,11 @@ def output_iterator(self) -> Iterator[Any]:
248
248
"""
249
249
Return an iterator of the prediction output.
250
250
"""
251
+ if (
252
+ self .status in ["succeeded" , "failed" , "canceled" ]
253
+ and self .output is not None
254
+ ):
255
+ yield from self .output
251
256
252
257
# TODO: check output is list
253
258
previous_output = self .output or []
@@ -270,6 +275,12 @@ async def async_output_iterator(self) -> AsyncIterator[Any]:
270
275
"""
271
276
Return an asynchronous iterator of the prediction output.
272
277
"""
278
+ if (
279
+ self .status in ["succeeded" , "failed" , "canceled" ]
280
+ and self .output is not None
281
+ ):
282
+ for item in self .output :
283
+ yield item
273
284
274
285
# TODO: check output is list
275
286
previous_output = self .output or []
You can’t perform that action at this time.
0 commit comments