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:
Classic298
2025-12-20 08:43:40 -05:00
committed by GitHub
co-authored by Tim Baek Claude
parent b0d8372d31
commit 2e7c7d635d
5 changed files with 27 additions and 1 deletions
+1 -1
View File
@@ -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