From d2e9e3cca1bab7a8c6df83e8cf8d8548200969d1 Mon Sep 17 00:00:00 2001 From: Steffy-zxf <48793257+Steffy-zxf@users.noreply.github.com> Date: Mon, 16 Mar 2020 16:38:16 +0800 Subject: [PATCH] Fix typo (#447) * fix-typo --- paddlehub/module/nlp_module.py | 2 +- paddlehub/serving/app_single.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paddlehub/module/nlp_module.py b/paddlehub/module/nlp_module.py index 65479b14d..f99a672d2 100644 --- a/paddlehub/module/nlp_module.py +++ b/paddlehub/module/nlp_module.py @@ -111,7 +111,7 @@ def to_unicode(self, texts): if six.PY2: unicode_texts = [] for text in texts: - if not isinstance(text, six.string_types): + if isinstance(text, six.string_types): unicode_texts.append( text.decode(sys_stdin_encoding()).decode("utf8")) else: diff --git a/paddlehub/serving/app_single.py b/paddlehub/serving/app_single.py index f9e308ef1..a6975295c 100644 --- a/paddlehub/serving/app_single.py +++ b/paddlehub/serving/app_single.py @@ -427,7 +427,7 @@ def predict_text(module_name): return {"error": "Module {} is not available.".format(module_name)} module_info = nlp_module_info.get_module_info(module_name) if module_info["code_version"] == "v2": - results = "This usage is out of date, please use 'application/json' as content-type to post to /predict/%s. See 'https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.5/docs/tutorial/serving.md' for more details." % ( + results = "This usage is out of date, please use 'application/json' as content-type to post to /predict/%s. See 'https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.6/docs/tutorial/serving.md' for more details." % ( module_name) return gen_result("-1", results, "") req_id = request.data.get("id") @@ -460,7 +460,7 @@ def predict_modulev2(module_name): return gen_result("-1", msg, "") inputs = request.json if inputs is None: - results = "This usage is out of date, please use 'application/json' as content-type to post to /predict/%s. See 'https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.5/docs/tutorial/serving.md' for more details." % ( + results = "This usage is out of date, please use 'application/json' as content-type to post to /predict/%s. See 'https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.6/docs/tutorial/serving.md' for more details." % ( module_name) return gen_result("-1", results, "")