Skip to content

Commit f5d25f3

Browse files
committed
缩短非DEBUG情况下的LPMM日志长度
1 parent 407a19c commit f5d25f3

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

src/chat/knowledge/embedding_store.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@ def load_from_file(self) -> None:
201201
"""从文件中加载"""
202202
if not os.path.exists(self.embedding_file_path):
203203
raise Exception(f"文件{self.embedding_file_path}不存在")
204-
logger.info(f"正在从文件{self.embedding_file_path}中加载{self.namespace}嵌入库")
204+
logger.info("正在加载嵌入库...")
205+
logger.debug(f"正在从文件{self.embedding_file_path}中加载{self.namespace}嵌入库")
205206
data_frame = pd.read_parquet(self.embedding_file_path, engine="pyarrow")
206207
total = len(data_frame)
207208
with Progress(
@@ -224,13 +225,15 @@ def load_from_file(self) -> None:
224225

225226
try:
226227
if os.path.exists(self.index_file_path):
227-
logger.info(f"正在从文件{self.index_file_path}中加载{self.namespace}嵌入库的FaissIndex")
228+
logger.info(f"正在加载{self.namespace}嵌入库的FaissIndex...")
229+
logger.debug(f"正在从文件{self.index_file_path}中加载{self.namespace}嵌入库的FaissIndex")
228230
self.faiss_index = faiss.read_index(self.index_file_path)
229231
logger.info(f"{self.namespace}嵌入库的FaissIndex加载成功")
230232
else:
231233
raise Exception(f"文件{self.index_file_path}不存在")
232234
if os.path.exists(self.idx2hash_file_path):
233-
logger.info(f"正在从文件{self.idx2hash_file_path}中加载{self.namespace}嵌入库的idx2hash映射")
235+
logger.info(f"正在加载{self.namespace}嵌入库的idx2hash映射...")
236+
logger.debug(f"正在从文件{self.idx2hash_file_path}中加载{self.namespace}嵌入库的idx2hash映射")
234237
with open(self.idx2hash_file_path, "r") as f:
235238
self.idx2hash = json.load(f)
236239
logger.info(f"{self.namespace}嵌入库的idx2hash映射加载成功")

0 commit comments

Comments
 (0)