fix: async save docs to vector db
Some checks failed
Frontend Build / Format & Build Frontend (push) Has been cancelled
Frontend Build / Frontend Unit Tests (push) Has been cancelled
Deploy to HuggingFace Spaces / check-secret (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-main-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-cuda126-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-ollama-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Create and publish Docker images with specific build args / build-slim-image (linux/amd64, ubuntu-latest) (push) Has been cancelled
Create and publish Docker images with specific build args / build-slim-image (linux/arm64, ubuntu-24.04-arm) (push) Has been cancelled
Python CI / Format Backend (push) Has been cancelled
Deploy to HuggingFace Spaces / deploy (push) Has been cancelled
Create and publish Docker images with specific build args / merge-main-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-cuda126-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-ollama-images (push) Has been cancelled
Create and publish Docker images with specific build args / merge-slim-images (push) Has been cancelled

This commit is contained in:
Timothy Jaeryang Baek 2025-11-25 17:19:33 -05:00
parent c631659327
commit 4370dee79e

View file

@ -1689,7 +1689,7 @@ async def process_text(
log.debug(f"text_content: {text_content}") log.debug(f"text_content: {text_content}")
result = await run_in_threadpool( result = await run_in_threadpool(
save_docs_to_vector_db, request, docs, collection_name, user save_docs_to_vector_db, request, docs, collection_name, user=user
) )
if result: if result:
return { return {
@ -1721,7 +1721,12 @@ async def process_web(
if not request.app.state.config.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL: if not request.app.state.config.BYPASS_WEB_SEARCH_EMBEDDING_AND_RETRIEVAL:
await run_in_threadpool( await run_in_threadpool(
save_docs_to_vector_db, request, docs, collection_name, True, user save_docs_to_vector_db,
request,
docs,
collection_name,
overwrite=True,
user=user,
) )
else: else:
collection_name = None collection_name = None
@ -2464,7 +2469,12 @@ async def process_files_batch(
if all_docs: if all_docs:
try: try:
await run_in_threadpool( await run_in_threadpool(
save_docs_to_vector_db, request, all_docs, collection_name, True, user save_docs_to_vector_db,
request,
all_docs,
collection_name,
add=True,
user=user,
) )
# Update all files with collection name # Update all files with collection name