fix: only log a reranking model change when the request carries one (#29922)

This commit is contained in:
G30 2026-09-12 17:04:14 -04:00 committed by GitHub
parent a910b0d8f6
commit ee4834e299
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1215,7 +1215,8 @@ async def update_rag_config(request: Request, form_data: ConfigForm, user=Depend
else config.RAG_RERANKING_BATCH_SIZE
)
log.info('Updating reranking model: %s to %s', config.RAG_RERANKING_MODEL, form_data.RAG_RERANKING_MODEL)
if form_data.RAG_RERANKING_MODEL is not None:
log.info('Updating reranking model: %s to %s', config.RAG_RERANKING_MODEL, form_data.RAG_RERANKING_MODEL)
try:
config.RAG_RERANKING_MODEL = (
form_data.RAG_RERANKING_MODEL if form_data.RAG_RERANKING_MODEL is not None else config.RAG_RERANKING_MODEL