From 88a4b015567ea56731db98389c3cacea6c0e10c9 Mon Sep 17 00:00:00 2001 From: tt-P607 <68868379+tt-P607@users.noreply.github.com> Date: Sun, 19 Oct 2025 14:11:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A9=E5=AD=90=E4=BB=AC=EF=BC=8C=E7=9F=A5?= =?UTF-8?q?=E8=AF=86=E5=BA=93=E7=9A=84=E9=AB=98=E5=B9=B6=E5=8F=91=E5=A4=AA?= =?UTF-8?q?=E6=81=90=E6=80=96=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/lpmm_learning_tool.py | 2 +- src/chat/knowledge/embedding_store.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/lpmm_learning_tool.py b/scripts/lpmm_learning_tool.py index dc9bda57b..1b7ebb2b1 100644 --- a/scripts/lpmm_learning_tool.py +++ b/scripts/lpmm_learning_tool.py @@ -204,7 +204,7 @@ def extract_information(paragraphs_dict, model_set): failed_hashes, open_ie_docs = [], [] - with ThreadPoolExecutor(max_workers=5) as executor: + with ThreadPoolExecutor(max_workers=3) as executor: f_to_hash = { executor.submit(extract_info_sync, p_hash, p, model_set): p_hash for p_hash, p in paragraphs_dict.items() diff --git a/src/chat/knowledge/embedding_store.py b/src/chat/knowledge/embedding_store.py index 2c1056bb1..dd9251230 100644 --- a/src/chat/knowledge/embedding_store.py +++ b/src/chat/knowledge/embedding_store.py @@ -30,8 +30,8 @@ from .utils.hash import get_sha256 install(extra_lines=3) # 多线程embedding配置常量 -DEFAULT_MAX_WORKERS = 10 # 默认最大线程数 -DEFAULT_CHUNK_SIZE = 10 # 默认每个线程处理的数据块大小 +DEFAULT_MAX_WORKERS = 3 # 默认最大线程数 +DEFAULT_CHUNK_SIZE = 5 # 默认每个线程处理的数据块大小 MIN_CHUNK_SIZE = 1 # 最小分块大小 MAX_CHUNK_SIZE = 50 # 最大分块大小 MIN_WORKERS = 1 # 最小线程数