mirror of
https://git.mirrors.martin98.com/https://github.com/infiniflow/ragflow.git
synced 2025-08-14 03:25:57 +08:00
fix: stop rerank by model when search result is empty (#4203)
### What problem does this PR solve? stop rerank by model when search result is empty, otherwise rerank may raise an error (qwen). ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue) Co-authored-by: 刘博 <liubo@ynby.cn>
This commit is contained in:
parent
76cd23eecf
commit
321e9f3719
@ -313,7 +313,7 @@ class Dealer:
|
|||||||
ranks["total"] = sres.total
|
ranks["total"] = sres.total
|
||||||
|
|
||||||
if page <= RERANK_PAGE_LIMIT:
|
if page <= RERANK_PAGE_LIMIT:
|
||||||
if rerank_mdl:
|
if rerank_mdl and sres.total > 0:
|
||||||
sim, tsim, vsim = self.rerank_by_model(rerank_mdl,
|
sim, tsim, vsim = self.rerank_by_model(rerank_mdl,
|
||||||
sres, question, 1 - vector_similarity_weight, vector_similarity_weight)
|
sres, question, 1 - vector_similarity_weight, vector_similarity_weight)
|
||||||
else:
|
else:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user