Kevin Hu commited on
Commit
8d91371
·
1 Parent(s): 341f7d8

fix empty graph issue (#1939)

Browse files

### What problem does this PR solve?


### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)

Files changed (1) hide show
  1. graphrag/index.py +1 -1
graphrag/index.py CHANGED
@@ -85,7 +85,7 @@ def build_knowlege_graph_chunks(tenant_id: str, chunks: List[str], callback, ent
85
  graphs.append(_.result().output)
86
  callback(0.5 + 0.1*i/len(threads), f"Entities extraction progress ... {i+1}/{len(threads)}")
87
 
88
- graph = reduce(graph_merge, graphs)
89
  er = EntityResolution(llm_bdl)
90
  graph = er(graph).output
91
 
 
85
  graphs.append(_.result().output)
86
  callback(0.5 + 0.1*i/len(threads), f"Entities extraction progress ... {i+1}/{len(threads)}")
87
 
88
+ graph = reduce(graph_merge, graphs) if graphs else nx.Graph()
89
  er = EntityResolution(llm_bdl)
90
  graph = er(graph).output
91