mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
Make the update script shorter. (#4854)
### What problem does this PR solve? ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -244,11 +244,16 @@ class KGSearch(Dealer):
|
||||
else:
|
||||
continue
|
||||
rel["description"] = rela["description"]
|
||||
desc = rel["description"]
|
||||
try:
|
||||
desc = json.loads(desc).get("description", "")
|
||||
except Exception:
|
||||
pass
|
||||
relas.append({
|
||||
"From Entity": f,
|
||||
"To Entity": t,
|
||||
"Score": "%.2f" % (rel["sim"] * rel["pagerank"]),
|
||||
"Description": json.loads(rel["description"]).get("description", "")
|
||||
"Description": desc
|
||||
})
|
||||
max_token -= num_tokens_from_string(str(relas[-1]))
|
||||
if max_token <= 0:
|
||||
|
||||
Reference in New Issue
Block a user