From cb0af184374d971201aed14057a86ee59e3b9884 Mon Sep 17 00:00:00 2001 From: zazula Date: Sat, 28 Jun 2025 05:44:18 -0700 Subject: [PATCH] fix ollama embeddings --- backend/open_webui/retrieval/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/retrieval/utils.py b/backend/open_webui/retrieval/utils.py index 683f42819bf..b0a5f561705 100644 --- a/backend/open_webui/retrieval/utils.py +++ b/backend/open_webui/retrieval/utils.py @@ -766,12 +766,12 @@ def generate_ollama_batch_embeddings( log.debug( f"generate_ollama_batch_embeddings:model {model} batch size: {len(texts)}" ) - json_data = {"input": texts, "model": model} + json_data = {"input": texts, "model": model, "prompt": "\n".join(texts)} if isinstance(RAG_EMBEDDING_PREFIX_FIELD_NAME, str) and isinstance(prefix, str): json_data[RAG_EMBEDDING_PREFIX_FIELD_NAME] = prefix r = requests.post( - f"{url}/api/embed", + f"{url}/api/embeddings", headers={ "Content-Type": "application/json", "Authorization": f"Bearer {key}",