Kevin Hu commited on
Commit
bf4c34e
·
1 Parent(s): 2646b91

fix: double brace issue (#3328)

Browse files

### What problem does this PR solve?

#3299

### Type of change

- [x] Performance Improvement

graphrag/community_reports_extractor.py CHANGED
@@ -80,6 +80,8 @@ class CommunityReportsExtractor:
80
  token_count += num_tokens_from_string(text + response)
81
  response = re.sub(r"^[^\{]*", "", response)
82
  response = re.sub(r"[^\}]*$", "", response)
 
 
83
  print(response)
84
  response = json.loads(response)
85
  if not dict_has_keys_with_types(response, [
 
80
  token_count += num_tokens_from_string(text + response)
81
  response = re.sub(r"^[^\{]*", "", response)
82
  response = re.sub(r"[^\}]*$", "", response)
83
+ response = re.sub(r"\{\{", "{", response)
84
+ response = re.sub(r"\}\}", "}", response)
85
  print(response)
86
  response = json.loads(response)
87
  if not dict_has_keys_with_types(response, [