瀏覽代碼

Fix: empty description (#5747)

### What problem does this PR solve?

#5705

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
tags/v0.17.1
Kevin Hu 7 月之前
父節點
當前提交
06b29d7da4
沒有連結到貢獻者的電子郵件帳戶。
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      graphrag/search.py

+ 1
- 1
graphrag/search.py 查看文件

@@ -228,7 +228,7 @@ class KGSearch(Dealer):
ents.append({
"Entity": n,
"Score": "%.2f" % (ent["sim"] * ent["pagerank"]),
"Description": json.loads(ent["description"]).get("description", "")
"Description": json.loads(ent["description"]).get("description", "") if ent["description"] else ""
})
max_token -= num_tokens_from_string(str(ents[-1]))
if max_token <= 0:

Loading…
取消
儲存