From 853aa121a955ea359f2b5e9e6c0ade057ab76b4b Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Wed, 14 Aug 2024 13:35:02 +0800 Subject: [PATCH] fix empty graph issue (#1939) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- graphrag/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphrag/index.py b/graphrag/index.py index f2835cc7a..b4e93c551 100644 --- a/graphrag/index.py +++ b/graphrag/index.py @@ -85,7 +85,7 @@ def build_knowlege_graph_chunks(tenant_id: str, chunks: List[str], callback, ent graphs.append(_.result().output) callback(0.5 + 0.1*i/len(threads), f"Entities extraction progress ... {i+1}/{len(threads)}") - graph = reduce(graph_merge, graphs) + graph = reduce(graph_merge, graphs) if graphs else nx.Graph() er = EntityResolution(llm_bdl) graph = er(graph).output