// encoding without blocking:
print("sending all data without blocking...")
for _ in range(10):
bc.encode(data, blocking=False)
print("done!")
num_expect_vecs = len(data) * 10
// then fetch all
After Change
// this time fetch them one by one, due to the async encoding and server scheduling
// sending order is NOT preserved!
for v in bc.fetch():
print("received %s, shape %s" % (v.id, v.content.shape))
// get encoded vectors
for j in bc.encode_async(text_gen(), max_num_batch=20):
print("received %d : %s" % (j.id, j.content))