Kevin Hu commited on
Commit
2324bcb
·
1 Parent(s): fde0f31

fix callback function error (#2096)

Browse files

### What problem does this PR solve?

#2085

### Type of change

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

Files changed (1) hide show
  1. graphrag/graph_extractor.py +1 -1
graphrag/graph_extractor.py CHANGED
@@ -131,7 +131,7 @@ class GraphExtractor:
131
  total_token_count += token_count
132
  if callback: callback(msg=f"{doc_index+1}/{total}, elapsed: {timer() - st}s, used tokens: {total_token_count}")
133
  except Exception as e:
134
- if callback: callback("Knowledge graph extraction error:{}".format(str(e)))
135
  logging.exception("error extracting graph")
136
  self._on_error(
137
  e,
 
131
  total_token_count += token_count
132
  if callback: callback(msg=f"{doc_index+1}/{total}, elapsed: {timer() - st}s, used tokens: {total_token_count}")
133
  except Exception as e:
134
+ if callback: callback(msg="Knowledge graph extraction error:{}".format(str(e)))
135
  logging.exception("error extracting graph")
136
  self._on_error(
137
  e,