From 462d6b5b93258c3a505d5b828867af5da1cb1d78 Mon Sep 17 00:00:00 2001 From: zl1271 Date: Fri, 13 Aug 2021 16:45:54 +0800 Subject: [PATCH] Update serving.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 参数名应为“text”而非“texts”,否则 api 会报错 { "msg": "cut() got an unexpected keyword argument 'texts'", "results": "", "status": "101" } --- docs/docs_ch/tutorial/serving.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/docs_ch/tutorial/serving.md b/docs/docs_ch/tutorial/serving.md index 9367e503..bc5f1f42 100755 --- a/docs/docs_ch/tutorial/serving.md +++ b/docs/docs_ch/tutorial/serving.md @@ -167,7 +167,7 @@ if __name__ == "__main__": text = ["今天是个好日子", "天气预报说今天要下雨"] # 以key的方式指定text传入预测方法的时的参数,此例中为"data" # 对应本地部署,则为lac.analysis_lexical(data=text, batch_size=1) - data = {"texts": text, "batch_size": 1} + data = {"text": text, "batch_size": 1} # 指定预测方法为lac并发送post请求,content-type类型应指定json方式 url = "http://127.0.0.1:8866/predict/lac" # 指定post请求的headers为application/json方式 -- GitLab