This commit is contained in:
Timothy Jaeryang Baek
2026-02-12 15:25:24 -06:00
parent 8cf32ae2a7
commit c653e4ec54
2 changed files with 13 additions and 2 deletions

View File

@@ -783,6 +783,17 @@ AIOHTTP_CLIENT_SESSION_TOOL_SERVER_SSL = (
)
RAG_EMBEDDING_TIMEOUT = os.environ.get("RAG_EMBEDDING_TIMEOUT", "")
if RAG_EMBEDDING_TIMEOUT == "":
RAG_EMBEDDING_TIMEOUT = None
else:
try:
RAG_EMBEDDING_TIMEOUT = int(RAG_EMBEDDING_TIMEOUT)
except Exception:
RAG_EMBEDDING_TIMEOUT = None
####################################
# SENTENCE TRANSFORMERS
####################################

View File

@@ -110,6 +110,7 @@ from open_webui.config import (
from open_webui.env import (
DEVICE_TYPE,
DOCKER,
RAG_EMBEDDING_TIMEOUT,
SENTENCE_TRANSFORMERS_BACKEND,
SENTENCE_TRANSFORMERS_MODEL_KWARGS,
SENTENCE_TRANSFORMERS_CROSS_ENCODER_BACKEND,
@@ -1592,8 +1593,7 @@ def save_docs_to_vector_db(
# Run async embedding in sync context using the main event loop
# This allows the main loop to stay responsive to health checks during long operations
embedding_timeout_str = os.environ.get("RAG_EMBEDDING_TIMEOUT")
embedding_timeout = int(embedding_timeout_str) if embedding_timeout_str else None
embedding_timeout = RAG_EMBEDDING_TIMEOUT
future = asyncio.run_coroutine_threadsafe(
embedding_function(