From c3e344b0f18149705177df20e0b1abc13c066136 Mon Sep 17 00:00:00 2001 From: Kevin Hu Date: Mon, 26 Aug 2024 14:12:52 +0800 Subject: [PATCH] fix callback function error (#2096) ### What problem does this PR solve? #2085 ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) --- graphrag/graph_extractor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graphrag/graph_extractor.py b/graphrag/graph_extractor.py index c2dc530ee..837f6ff2f 100644 --- a/graphrag/graph_extractor.py +++ b/graphrag/graph_extractor.py @@ -131,7 +131,7 @@ class GraphExtractor: total_token_count += token_count if callback: callback(msg=f"{doc_index+1}/{total}, elapsed: {timer() - st}s, used tokens: {total_token_count}") except Exception as e: - if callback: callback("Knowledge graph extraction error:{}".format(str(e))) + if callback: callback(msg="Knowledge graph extraction error:{}".format(str(e))) logging.exception("error extracting graph") self._on_error( e,