mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
Update knowledge.py (#19434)
This commit is contained in:
parent
a7b611c0e5
commit
0a687980ee
1 changed files with 3 additions and 1 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
from typing import List, Optional
|
from typing import List, Optional
|
||||||
from pydantic import BaseModel
|
from pydantic import BaseModel
|
||||||
from fastapi import APIRouter, Depends, HTTPException, status, Request, Query
|
from fastapi import APIRouter, Depends, HTTPException, status, Request, Query
|
||||||
|
from fastapi.concurrency import run_in_threadpool
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from open_webui.models.knowledge import (
|
from open_webui.models.knowledge import (
|
||||||
|
|
@ -223,7 +224,8 @@ async def reindex_knowledge_files(request: Request, user=Depends(get_verified_us
|
||||||
failed_files = []
|
failed_files = []
|
||||||
for file in files:
|
for file in files:
|
||||||
try:
|
try:
|
||||||
process_file(
|
await run_in_threadpool(
|
||||||
|
process_file,
|
||||||
request,
|
request,
|
||||||
ProcessFileForm(
|
ProcessFileForm(
|
||||||
file_id=file.id, collection_name=knowledge_base.id
|
file_id=file.id, collection_name=knowledge_base.id
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue