From 2302a6baba755fdb259c58f2546b038ff2b81ea9 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 19 Aug 2024 09:24:03 +0800 Subject: [PATCH] fix empty mind map issue (#1991) ### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- graphrag/mind_map_extractor.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graphrag/mind_map_extractor.py b/graphrag/mind_map_extractor.py index fabdaed08..652c871d6 100644 --- a/graphrag/mind_map_extractor.py +++ b/graphrag/mind_map_extractor.py @@ -105,6 +105,9 @@ class MindMapExtractor: for i, _ in enumerate(threads): res.append(_.result()) + if not res: + return MindMapResult(output={"root":{}}) + merge_json = reduce(self._merge, res) if len(merge_json.keys()) > 1: keyset = set(