From 4e5bc8b39984612f4b058def450e0f755934a222 Mon Sep 17 00:00:00 2001 From: liunux4odoo Date: Fri, 22 Dec 2023 10:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=20zhipu-api=20?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=87=BA=E9=94=99=E6=97=B6=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E5=87=86=E7=A1=AE=E7=9A=84=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- configs/model_config.py.example | 1 + server/model_workers/zhipu.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configs/model_config.py.example b/configs/model_config.py.example index 8e25ea5..d07b960 100644 --- a/configs/model_config.py.example +++ b/configs/model_config.py.example @@ -16,6 +16,7 @@ RERANKER_MODEL = "bge-reranker-large" # 是否启用reranker模型 USE_RERANKER = False RERANKER_MAX_LENGTH = 1024 + # 如果需要在 EMBEDDING_MODEL 中增加自定义的关键字时配置 EMBEDDING_KEYWORD_FILE = "keywords.txt" EMBEDDING_MODEL_OUTPUT_PATH = "output" diff --git a/server/model_workers/zhipu.py b/server/model_workers/zhipu.py index 4341937..0005c7d 100644 --- a/server/model_workers/zhipu.py +++ b/server/model_workers/zhipu.py @@ -46,9 +46,9 @@ class ChatGLMWorker(ApiModelWorker): elif e.event in ["error", "interrupted"]: data = { "error_code": 500, - "text": str(e), + "text": e.data, "error": { - "message": str(e), + "message": e.data, "type": "invalid_request_error", "param": None, "code": None,