From 4fe1f2487dde8458964d756a402c0a9278f87620 Mon Sep 17 00:00:00 2001 From: Hwang In Tak Date: Thu, 26 Sep 2024 20:48:14 +0900 Subject: [PATCH] fix: Fix OpenAI batch embedding --- backend/open_webui/apps/rag/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/open_webui/apps/rag/main.py b/backend/open_webui/apps/rag/main.py index 4efa1d81c2..7b476c0563 100644 --- a/backend/open_webui/apps/rag/main.py +++ b/backend/open_webui/apps/rag/main.py @@ -1112,7 +1112,9 @@ def store_docs_in_vector_db( app.state.config.RAG_EMBEDDING_OPENAI_BATCH_SIZE, ) - embedding_texts = list(map(lambda x: x.replace("\n", " "), texts)) + embedding_texts = embedding_function( + list(map(lambda x: x.replace("\n", " "), texts)) + ) VECTOR_DB_CLIENT.insert( collection_name=collection_name,