refac/fix: reranking function

This commit is contained in:
Timothy Jaeryang Baek
2025-07-16 13:56:02 +04:00
parent ae716bddee
commit abe280f0a3
2 changed files with 18 additions and 10 deletions

View File

@@ -653,13 +653,13 @@ async def chat_completion_files_handler(
),
k=request.app.state.config.TOP_K,
reranking_function=(
lambda sentences: (
request.app.state.RERANKING_FUNCTION(
(
lambda sentences: request.app.state.RERANKING_FUNCTION(
sentences, user=user
)
if request.app.state.RERANKING_FUNCTION
else None
)
if request.app.state.RERANKING_FUNCTION
else None
),
k_reranker=request.app.state.config.TOP_K_RERANKER,
r=request.app.state.config.RELEVANCE_THRESHOLD,