From edf6c6a18ca83746ab6762a26dc3fe381f99fe9c Mon Sep 17 00:00:00 2001 From: Sanchit Hira Date: Tue, 10 Dec 2024 00:17:49 -0800 Subject: [PATCH] turn off auto update in offline mode --- backend/open_webui/config.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index c0a0f63b5..fe5f12fbc 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -21,6 +21,7 @@ from open_webui.env import ( WEBUI_NAME, log, DATABASE_URL, + OFFLINE_MODE ) from pydantic import BaseModel from sqlalchemy import JSON, Column, DateTime, Integer, func @@ -1197,7 +1198,7 @@ RAG_EMBEDDING_MODEL = PersistentConfig( log.info(f"Embedding model set: {RAG_EMBEDDING_MODEL.value}") RAG_EMBEDDING_MODEL_AUTO_UPDATE = ( - os.environ.get("RAG_EMBEDDING_MODEL_AUTO_UPDATE", "True").lower() == "true" + not OFFLINE_MODE and os.environ.get("RAG_EMBEDDING_MODEL_AUTO_UPDATE", "True").lower() == "true" ) RAG_EMBEDDING_MODEL_TRUST_REMOTE_CODE = ( @@ -1222,7 +1223,7 @@ if RAG_RERANKING_MODEL.value != "": log.info(f"Reranking model set: {RAG_RERANKING_MODEL.value}") RAG_RERANKING_MODEL_AUTO_UPDATE = ( - os.environ.get("RAG_RERANKING_MODEL_AUTO_UPDATE", "True").lower() == "true" + not OFFLINE_MODE and os.environ.get("RAG_RERANKING_MODEL_AUTO_UPDATE", "True").lower() == "true" ) RAG_RERANKING_MODEL_TRUST_REMOTE_CODE = ( @@ -1686,7 +1687,7 @@ WHISPER_MODEL = PersistentConfig( WHISPER_MODEL_DIR = os.getenv("WHISPER_MODEL_DIR", f"{CACHE_DIR}/whisper/models") WHISPER_MODEL_AUTO_UPDATE = ( - os.environ.get("WHISPER_MODEL_AUTO_UPDATE", "").lower() == "true" + not OFFLINE_MODE and os.environ.get("WHISPER_MODEL_AUTO_UPDATE", "").lower() == "true" )