From e8c022d24ee887a04cb9f9582b2c3d5502c06a1f Mon Sep 17 00:00:00 2001 From: barrierye Date: Thu, 30 Apr 2020 11:51:00 +0800 Subject: [PATCH] fix benchmark_batch.py --- python/examples/imdb/benchmark_batch.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/python/examples/imdb/benchmark_batch.py b/python/examples/imdb/benchmark_batch.py index 34c777c7..5891970b 100644 --- a/python/examples/imdb/benchmark_batch.py +++ b/python/examples/imdb/benchmark_batch.py @@ -53,15 +53,14 @@ def single_func(idx, resource): if args.batch_size >= 1: feed_batch = [] for bi in range(args.batch_size): - word_ids, label = imdb_dataset.get_words_and_label(dataset[bi]) - feed_batch.append({"words": word_ids}) + feed_batch.append({"words": dataset[bi]}) r = requests.post( "http://{}/imdb/prediction".format(args.endpoint), json={"feed": feed_batch, "fetch": ["prediction"]}) if r.status_code != 200: print('HTTP status code -ne 200') - exit(1) + raise ("predict failed.") else: print("unsupport batch size {}".format(args.batch_size)) end = time.time() -- GitLab