From 6ce9afd95dee1bda88d8f491bf1ecbc5cf37a3db Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 2 Dec 2025 09:21:03 -0500 Subject: [PATCH] refac --- backend/open_webui/main.py | 5 ++--- backend/open_webui/routers/retrieval.py | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/backend/open_webui/main.py b/backend/open_webui/main.py index 127f22e103..087dc5fb03 100644 --- a/backend/open_webui/main.py +++ b/backend/open_webui/main.py @@ -983,8 +983,7 @@ app.state.YOUTUBE_LOADER_TRANSLATION = None try: app.state.ef = get_ef( app.state.config.RAG_EMBEDDING_ENGINE, - app.state.config.RAG_EMBEDDING_MODEL, - RAG_EMBEDDING_MODEL_AUTO_UPDATE, + app.state.config.RAG_EMBEDDING_MODEL ) if ( app.state.config.ENABLE_RAG_HYBRID_SEARCH @@ -995,7 +994,7 @@ try: app.state.config.RAG_RERANKING_MODEL, app.state.config.RAG_EXTERNAL_RERANKER_URL, app.state.config.RAG_EXTERNAL_RERANKER_API_KEY, - RAG_RERANKING_MODEL_AUTO_UPDATE, + ) else: app.state.rf = None diff --git a/backend/open_webui/routers/retrieval.py b/backend/open_webui/routers/retrieval.py index 72090e3ba0..190f001edd 100644 --- a/backend/open_webui/routers/retrieval.py +++ b/backend/open_webui/routers/retrieval.py @@ -123,7 +123,7 @@ log.setLevel(SRC_LOG_LEVELS["RAG"]) def get_ef( engine: str, embedding_model: str, - auto_update: bool = False, + auto_update: bool = RAG_EMBEDDING_MODEL_AUTO_UPDATE, ): ef = None if embedding_model and engine == "": @@ -148,7 +148,7 @@ def get_rf( reranking_model: Optional[str] = None, external_reranker_url: str = "", external_reranker_api_key: str = "", - auto_update: bool = False, + auto_update: bool = RAG_RERANKING_MODEL_AUTO_UPDATE, ): rf = None if reranking_model: @@ -927,7 +927,6 @@ async def update_rag_config( request.app.state.config.RAG_RERANKING_MODEL, request.app.state.config.RAG_EXTERNAL_RERANKER_URL, request.app.state.config.RAG_EXTERNAL_RERANKER_API_KEY, - True, ) request.app.state.RERANKING_FUNCTION = get_reranking_function(