devMls commited on
Commit
533604b
·
1 Parent(s): bc59ad5

Fix bug over chunks classification by document in the promp (#4156)

Browse files

The refactor in 0.15 contains a small bug that eliminate the
classification

### What problem does this PR solve

### Type of change

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

Files changed (1) hide show
  1. api/db/services/dialog_service.py +1 -1
api/db/services/dialog_service.py CHANGED
@@ -124,7 +124,7 @@ def kb_prompt(kbinfos, max_tokens):
124
  for i, ck in enumerate(kbinfos["chunks"]):
125
  if i >= chunks_num:
126
  break
127
- doc2chunks["docnm_kwd"].append(ck["content_with_weight"])
128
 
129
  knowledges = []
130
  for nm, chunks in doc2chunks.items():
 
124
  for i, ck in enumerate(kbinfos["chunks"]):
125
  if i >= chunks_num:
126
  break
127
+ doc2chunks[ck["docnm_kwd"]].append(ck["content_with_weight"])
128
 
129
  knowledges = []
130
  for nm, chunks in doc2chunks.items():