ソースを参照

boost paralal of graphrag (#1924)

### What problem does this PR solve?


### Type of change

- [x] Performance Improvement
tags/v0.10.0
Kevin Hu 1年前
コミット
da2d8b8267
コミッターのメールアドレスに関連付けられたアカウントが存在しません
1個のファイルの変更2行の追加2行の削除
  1. 2
    2
      graphrag/index.py

+ 2
- 2
graphrag/index.py ファイルの表示

@@ -61,11 +61,11 @@ def build_knowlege_graph_chunks(tenant_id: str, chunks: List[str], callback, ent

assert left_token_count > 0, f"The LLM context length({llm_bdl.max_length}) is smaller than prompt({ext.prompt_token_count})"

BATCH_SIZE=1
BATCH_SIZE=4
texts, graphs = [], []
cnt = 0
threads = []
exe = ThreadPoolExecutor(max_workers=12)
exe = ThreadPoolExecutor(max_workers=50)
for i in range(len(chunks)):
tkn_cnt = num_tokens_from_string(chunks[i])
if cnt+tkn_cnt >= left_token_count and texts:

読み込み中…
キャンセル
保存