fix: prevent ExternalReranker from blocking event loop during RAG queries (#20049)
* fix: prevent ExternalReranker from blocking event loop during RAG queries (#120) Co-authored-by: Tim Baek <tim@openwebui.com> Co-authored-by: Claude <noreply@anthropic.com> Fixes #19900 * Merge pull request open-webui#19030 from open-webui/dev (#122) Co-authored-by: Tim Baek <tim@openwebui.com> Co-authored-by: Claude <noreply@anthropic.com> Fixes #19900 --------- Co-authored-by: Tim Baek <tim@openwebui.com> Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
co-authored by
Tim Baek
Claude
parent
b0d8372d31
commit
2e7c7d635d
@@ -1279,7 +1279,7 @@ class RerankCompressor(BaseDocumentCompressor):
|
||||
|
||||
scores = None
|
||||
if reranking:
|
||||
scores = self.reranking_function(query, documents)
|
||||
scores = await asyncio.to_thread(self.reranking_function, query, documents)
|
||||
else:
|
||||
from sentence_transformers import util
|
||||
|
||||
|
||||
Reference in New Issue
Block a user