From 44efd4d37236b29c865c35910175abfdc84f4753 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Tue, 26 Nov 2024 10:17:17 -0800 Subject: [PATCH] refac --- backend/open_webui/apps/retrieval/utils.py | 2 +- .../admin/Settings/Models/ConfigureModelsModal.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/apps/retrieval/utils.py b/backend/open_webui/apps/retrieval/utils.py index 35159f80d..bf939ecf1 100644 --- a/backend/open_webui/apps/retrieval/utils.py +++ b/backend/open_webui/apps/retrieval/utils.py @@ -429,7 +429,7 @@ def generate_openai_batch_embeddings( def generate_ollama_batch_embeddings( - model: str, texts: list[str], url: str, key: str + model: str, texts: list[str], url: str, key: str = "" ) -> Optional[list[list[float]]]: try: r = requests.post( diff --git a/src/lib/components/admin/Settings/Models/ConfigureModelsModal.svelte b/src/lib/components/admin/Settings/Models/ConfigureModelsModal.svelte index cf78e4180..c62afc332 100644 --- a/src/lib/components/admin/Settings/Models/ConfigureModelsModal.svelte +++ b/src/lib/components/admin/Settings/Models/ConfigureModelsModal.svelte @@ -51,7 +51,7 @@ onMount(async () => { config = await getModelsConfig(localStorage.token); - defaultModelIds = config.DEFAULT_MODELS.split(',').filter((id) => id); + defaultModelIds = (config?.DEFAULT_MODELS ?? '').split(',').filter((id) => id); const modelOrderList = config.MODEL_ORDER_LIST || []; const allModelIds = $models.map((model) => model.id);