This commit is contained in:
Timothy Jaeryang Baek
2025-07-14 14:05:06 +04:00
parent 0013f5c1fc
commit 18bd83413b
3 changed files with 16 additions and 4 deletions
+6 -2
View File
@@ -2049,8 +2049,12 @@ def query_doc_handler(
query, prefix=prefix, user=user
),
k=form_data.k if form_data.k else request.app.state.config.TOP_K,
reranking_function=lambda sentences: request.app.state.RERANKING_FUNCTION(
sentences, user=user
reranking_function=(
lambda sentences: (
request.app.state.RERANKING_FUNCTION(sentences, user=user)
if request.app.state.RERANKING_FUNCTION
else None
)
),
k_reranker=form_data.k_reranker
or request.app.state.config.TOP_K_RERANKER,