Skip to content

Commit

Permalink
Fix typo (PaddlePaddle#447)
Browse files Browse the repository at this point in the history
* fix-typo
  • Loading branch information
Steffy-zxf authored Mar 16, 2020
1 parent f0472f7 commit d2e9e3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion paddlehub/module/nlp_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions paddlehub/serving/app_single.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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, "")

Expand Down

0 comments on commit d2e9e3c

Please sign in to comment.