Skip to content

Commit 853aa12

Browse files
authored
fix empty graph issue (infiniflow#1939)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
1 parent 54fc6dc commit 853aa12

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graphrag/index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def build_knowlege_graph_chunks(tenant_id: str, chunks: List[str], callback, ent
8585
graphs.append(_.result().output)
8686
callback(0.5 + 0.1*i/len(threads), f"Entities extraction progress ... {i+1}/{len(threads)}")
8787

88-
graph = reduce(graph_merge, graphs)
88+
graph = reduce(graph_merge, graphs) if graphs else nx.Graph()
8989
er = EntityResolution(llm_bdl)
9090
graph = er(graph).output
9191

0 commit comments

Comments
 (0)