mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-06 08:18:53 +00:00
fix: revert merge_docs_to_target_size to sync
Caller save_docs_to_vector_db is synchronous, so await inside it is invalid.
This commit is contained in:
parent
777fa6ca89
commit
fc722a6fa2
1 changed files with 2 additions and 2 deletions
|
|
@ -1255,7 +1255,7 @@ def can_merge_chunks(a: Document, b: Document) -> bool:
|
|||
return True
|
||||
|
||||
|
||||
async def merge_docs_to_target_size(
|
||||
def merge_docs_to_target_size(
|
||||
request: Request,
|
||||
chunks: list[Document],
|
||||
) -> list[Document]:
|
||||
|
|
@ -1436,7 +1436,7 @@ def save_docs_to_vector_db(
|
|||
|
||||
docs = split_docs
|
||||
if request.app.state.config.CHUNK_MIN_SIZE_TARGET > 0:
|
||||
docs = await merge_docs_to_target_size(request, docs)
|
||||
docs = merge_docs_to_target_size(request, docs)
|
||||
|
||||
if request.app.state.config.TEXT_SPLITTER in ['', 'character']:
|
||||
text_splitter = RecursiveCharacterTextSplitter(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue