File tree 2 files changed +5
-2
lines changed
2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ async def predict_stream_of_tensor_lists_from_single_tensor_list_async(
130
130
inputs = tensor_list ,
131
131
parameters = parameters_tensor ,
132
132
)
133
- async for response in prediction_service_async_client .server_streaming_predict (
133
+ async for response in await prediction_service_async_client .server_streaming_predict (
134
134
request = request
135
135
):
136
136
yield response .outputs
Original file line number Diff line number Diff line change @@ -1484,12 +1484,15 @@ async def test_text_generation_model_predict_streaming_async(self):
1484
1484
"text-bison@001"
1485
1485
)
1486
1486
1487
- async def mock_server_streaming_predict_async (* args , ** kwargs ):
1487
+ async def mock_server_streaming_predict_async_iter (* args , ** kwargs ):
1488
1488
for response_dict in _TEST_TEXT_GENERATION_PREDICTION_STREAMING :
1489
1489
yield gca_prediction_service .StreamingPredictResponse (
1490
1490
outputs = [_streaming_prediction .value_to_tensor (response_dict )]
1491
1491
)
1492
1492
1493
+ async def mock_server_streaming_predict_async (* args , ** kwargs ):
1494
+ return mock_server_streaming_predict_async_iter (* args , ** kwargs )
1495
+
1493
1496
with mock .patch .object (
1494
1497
target = prediction_service_async_client .PredictionServiceAsyncClient ,
1495
1498
attribute = "server_streaming_predict" ,
You can’t perform that action at this time.
0 commit comments