diff --git a/paddlehub/module/nlp_module.py b/paddlehub/module/nlp_module.py index 65479b14d207ad6332d37511938176c8314ff047..f99a672d204dca47285c7ff452c83bc9ca64a8a8 100644 --- a/paddlehub/module/nlp_module.py +++ b/paddlehub/module/nlp_module.py @@ -111,7 +111,7 @@ class NLPPredictionModule(NLPBaseModule): 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 f9e308ef16b2f5f0b5024a449691ec964b78e4d8..a6975295c53e51b3535bd8255184bf0847635bb9 100644 --- a/paddlehub/serving/app_single.py +++ b/paddlehub/serving/app_single.py @@ -427,7 +427,7 @@ def create_app(init_flag=False, configs=None): 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 create_app(init_flag=False, configs=None): 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, "")