未验证 提交 d2e9e3cc 编写于 作者: S Steffy-zxf 提交者: GitHub

Fix typo (#447)

* fix-typo
上级 f0472f7b
......@@ -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:
......
......@@ -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, "")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册