From 7d60e263509d699e7f12b10ada49204aff8d7ab5 Mon Sep 17 00:00:00 2001 From: Steffy-zxf <48793257+Steffy-zxf@users.noreply.github.com> Date: Tue, 18 Aug 2020 11:49:27 +0800 Subject: [PATCH] Revert "modify lac serving demo. (#824)" This reverts commit 0d3542b22f52fee9c737338e6d06052ea70866ec. --- demo/serving/module_serving/lexical_analysis_lac/README.md | 2 +- .../module_serving/lexical_analysis_lac/lac_serving_demo.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/demo/serving/module_serving/lexical_analysis_lac/README.md b/demo/serving/module_serving/lexical_analysis_lac/README.md index 6fbe296c..b91346da 100644 --- a/demo/serving/module_serving/lexical_analysis_lac/README.md +++ b/demo/serving/module_serving/lexical_analysis_lac/README.md @@ -146,4 +146,4 @@ if __name__ == "__main__": ] } ``` -此Demo的具体信息和代码请参见[LAC Serving](./lac_serving_demo.py)。 +此Demo的具体信息和代码请参见[LAC Serving_2.1.0](lac_2.1.0_serving_demo.py)。 diff --git a/demo/serving/module_serving/lexical_analysis_lac/lac_serving_demo.py b/demo/serving/module_serving/lexical_analysis_lac/lac_serving_demo.py index 96a585bf..05e40f8a 100644 --- a/demo/serving/module_serving/lexical_analysis_lac/lac_serving_demo.py +++ b/demo/serving/module_serving/lexical_analysis_lac/lac_serving_demo.py @@ -7,8 +7,7 @@ if __name__ == "__main__": text = ["今天是个好日子", "天气预报说今天要下雨"] # 以key的方式指定text传入预测方法的时的参数,此例中为"data" # 对应本地部署,则为lac.analysis_lexical(data=text, batch_size=1) - # 若使用lac版本低于2.2.0,需要将`text`参数改为`texts` - data = {"text": text, "batch_size": 1} + data = {"texts": text, "batch_size": 1} # 指定预测方法为lac并发送post请求,content-type类型应指定json方式 url = "http://127.0.0.1:8866/predict/lac" # 指定post请求的headers为application/json方式 -- GitLab