diff --git a/python/examples/bert/bert_client.py b/python/examples/bert/bert_client.py index b378f9f791bce4abfe79b068c1875d9b66f1791c..4111589b3ddfde980e415fbac1a5f38f4abafada 100644 --- a/python/examples/bert/bert_client.py +++ b/python/examples/bert/bert_client.py @@ -33,5 +33,5 @@ for line in sys.stdin: for key in feed_dict.keys(): feed_dict[key] = np.array(feed_dict[key]).reshape((128, 1)) #print(feed_dict) - result = client.predict(feed=feed_dict, fetch=fetch, batch=True) + result = client.predict(feed=feed_dict, fetch=fetch, batch=False) print(result) diff --git a/python/examples/bert/bert_web_service.py b/python/examples/bert/bert_web_service.py index e1260dd1c2942fc806f6fd6b2199feb9467a8c2b..7cd34fb99e0ecebbf2f6bec47e9c9d163ac3a44c 100644 --- a/python/examples/bert/bert_web_service.py +++ b/python/examples/bert/bert_web_service.py @@ -29,7 +29,7 @@ class BertService(WebService): def preprocess(self, feed=[], fetch=[]): feed_res = [] - is_batch = True + is_batch = False for ins in feed: feed_dict = self.reader.process(ins["words"].encode("utf-8")) for key in feed_dict.keys(): diff --git a/python/examples/imdb/text_classify_service.py b/python/examples/imdb/text_classify_service.py index 1d292194f963466d3e53859dc9e4c6da1789ea20..ca1e26002baf0284f282add235706080f7902c33 100755 --- a/python/examples/imdb/text_classify_service.py +++ b/python/examples/imdb/text_classify_service.py @@ -29,13 +29,14 @@ class IMDBService(WebService): def preprocess(self, feed={}, fetch=[]): feed_batch = [] words_lod = [0] + is_batch = True for ins in feed: words = self.dataset.get_words_only(ins["words"]) words = np.array(words).reshape(len(words), 1) words_lod.append(words_lod[-1] + len(words)) feed_batch.append(words) feed = {"words": np.concatenate(feed_batch), "words.lod": words_lod} - return feed, fetch + return feed, fetch, is_batch imdb_service = IMDBService(name="imdb") diff --git a/python/setup.py.app.in b/python/setup.py.app.in index 1a06b0d352c1da4cdd09f74cb900853d4016afa8..8480ed8471e60c7e7eb8f14bf11a1cc2d23204cf 100644 --- a/python/setup.py.app.in +++ b/python/setup.py.app.in @@ -32,8 +32,8 @@ if '${PACK}' == 'ON': REQUIRED_PACKAGES = [ - 'six >= 1.10.0', 'sentencepiece', 'opencv-python<=4.2.0.32', 'pillow', - 'shapely<=1.6.1', 'pyclipper' + 'six >= 1.10.0', 'sentencepiece<=0.1.92', 'opencv-python<=4.2.0.32', 'pillow', + 'pyclipper' ] packages=['paddle_serving_app', diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..a1eb26e5cec23a8f76a50be48608f8a4532c6993 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +sphinx==2.1.0 +mistune +sphinx_rtd_theme +paddlepaddle>=1.8.4 +shapely<=1.6.1 diff --git a/doc/requirements.txt b/requirements_win.txt similarity index 58% rename from doc/requirements.txt rename to requirements_win.txt index 1560ebc5f9d74fbae773ac5bc45c5b42b044287a..a202642af70fec0c57642cc53b8ead82a5a7c7f1 100644 --- a/doc/requirements.txt +++ b/requirements_win.txt @@ -1,4 +1,5 @@ sphinx==2.1.0 mistune sphinx_rtd_theme -paddlepaddle>=1.6 +paddlepaddle>=1.8.4 +shapely