From dbf6ec71fe240793cd5e4e6686e48da6ccbe0cf7 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 30 Nov 2024 18:13:10 -0800 Subject: [PATCH] enh: remove trailing slash from ollama Co-Authored-By: hi-unc1e <67778054+hi-unc1e@users.noreply.github.com> --- backend/open_webui/config.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/open_webui/config.py b/backend/open_webui/config.py index bce1cde10..06a5a6811 100644 --- a/backend/open_webui/config.py +++ b/backend/open_webui/config.py @@ -583,6 +583,12 @@ OLLAMA_API_BASE_URL = os.environ.get( ) OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "") +if OLLAMA_BASE_URL: + # Remove trailing slash + OLLAMA_BASE_URL = ( + OLLAMA_BASE_URL[:-1] if OLLAMA_BASE_URL.endswith("/") else OLLAMA_BASE_URL + ) + K8S_FLAG = os.environ.get("K8S_FLAG", "") USE_OLLAMA_DOCKER = os.environ.get("USE_OLLAMA_DOCKER", "false")