From 1a0caf30d08d8562f0a6a2320915306a73e8eda5 Mon Sep 17 00:00:00 2001 From: liuyebo <1515783401@qq.com> Date: Thu, 17 Oct 2024 15:13:41 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E5=88=B6=E6=96=87=E6=9C=AC=E5=88=86?= =?UTF-8?q?=E7=B1=BB=E7=9A=84=E6=96=87=E6=9C=AC=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- util/model_util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/model_util.py b/util/model_util.py index 9d3324b..6cdd2ae 100644 --- a/util/model_util.py +++ b/util/model_util.py @@ -200,6 +200,8 @@ def clas_text(text): if not text: return None url = 'http://clas_text:5008' + if len(text) > 2048: + text = text[:2048] response = requests.post(url, {'text': text}) if response.status_code == 200: return response.json()