Skip to content

Commit

Permalink
fix: double brace issue (#3328)
Browse files Browse the repository at this point in the history
### What problem does this PR solve?

#3299

### Type of change

- [x] Performance Improvement
  • Loading branch information
KevinHuSh authored Nov 11, 2024
1 parent 34d1daa commit 88072b1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions graphrag/community_reports_extractor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def __call__(self, graph: nx.Graph, callback: Callable | None = None):
token_count += num_tokens_from_string(text + response)
response = re.sub(r"^[^\{]*", "", response)
response = re.sub(r"[^\}]*$", "", response)
response = re.sub(r"\{\{", "{", response)
response = re.sub(r"\}\}", "}", response)
print(response)
response = json.loads(response)
if not dict_has_keys_with_types(response, [
Expand Down

0 comments on commit 88072b1

Please sign in to comment.