You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
async def speed_testing_async_encode(self, batch_size: int = 32) -> np.ndarray:
'''
This function is for async_encode speed test.
You should NOT use this for normal encoding.
'''
coros = []
max_len = self.get_pad_maxlen()
for _ in range(10000):
coro = self.client.async_predict(
data=[
PredictInput(name='x', value=[list(range(max_len))]),
PredictInput(name='seqlen', value=[max_len]),
],
output_names=['latent_vector'],
model_name=self.model_name,
model_signature_name='encode',
)
coros.append(coro)
await asyncio.gather(*coros)
def get_pad_maxlen(self):
for step_info in self.pipe._step_info:
if step_info['op_name'] == 'Pad':
return step_info['op_kwargs']['maxlen']
raise KeyError("Can't find any `Pad` operation in pipe!")
The text was updated successfully, but these errors were encountered:
Liangtaiwan
changed the title
async_predict error when too many requests
async_predict error when coroutines too high
May 3, 2019
async_predict error when coroutines too high
for example
The text was updated successfully, but these errors were encountered: