Fix: add chunk, empty question issue. (#6405)

### What problem does this PR solve?

#6404

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
Kevin Hu 2025-03-21 18:44:12 +08:00 committed by GitHub
parent d88964f629
commit 394d1a86f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1067,7 +1067,7 @@ def add_chunk(tenant_id, dataset_id, document_id):
d["important_tks"] = rag_tokenizer.tokenize(
" ".join(req.get("important_keywords", []))
)
d["question_kwd"] = req.get("questions", [])
d["question_kwd"] = [str(q).strip() for q in req.get("questions", []) if str(q).strip()]
d["question_tks"] = rag_tokenizer.tokenize(
"\n".join(req.get("questions", []))
)