From b69c9ac7f742e0e5f260e04f10edf2a32a58bf5d Mon Sep 17 00:00:00 2001 From: Rikki Date: Fri, 7 Mar 2025 05:50:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E7=94=A8=20embedding=20=E6=A8=A1=E5=9E=8B=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E7=9A=84=E7=8E=B0=E8=B1=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/models/utils_model.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugins/models/utils_model.py b/src/plugins/models/utils_model.py index 793a89290..f06e94076 100644 --- a/src/plugins/models/utils_model.py +++ b/src/plugins/models/utils_model.py @@ -317,12 +317,11 @@ class LLM_request: logger.error("达到最大重试次数,请求仍然失败") raise RuntimeError("达到最大重试次数,API请求仍然失败") - def get_embedding_sync(self, text: str, model: str = "BAAI/bge-m3") -> Union[list, None]: + def get_embedding_sync(self, text: str) -> Union[list, None]: """同步方法:获取文本的embedding向量 Args: text: 需要获取embedding的文本 - model: 使用的模型名称,默认为"BAAI/bge-m3" Returns: list: embedding向量,如果失败则返回None @@ -333,7 +332,7 @@ class LLM_request: } data = { - "model": model, + "model": self.model_name, "input": text, "encoding_format": "float" }