mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-06 02:46:40 +00:00
format code
This commit is contained in:
parent
4eb06299e8
commit
fc6c9071ff
@ -1,4 +1,5 @@
|
|||||||
"""Index store base class."""
|
"""Index store base class."""
|
||||||
|
|
||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import logging
|
||||||
import time
|
import time
|
||||||
@ -192,6 +193,7 @@ class IndexStoreBase(ABC):
|
|||||||
logger.info(f"Loaded {loaded_cnt} chunks, total {len(chunks)} chunks.")
|
logger.info(f"Loaded {loaded_cnt} chunks, total {len(chunks)} chunks.")
|
||||||
|
|
||||||
return ids
|
return ids
|
||||||
|
|
||||||
async def _run_tasks_with_concurrency(self, tasks, max_concurrent):
|
async def _run_tasks_with_concurrency(self, tasks, max_concurrent):
|
||||||
results = []
|
results = []
|
||||||
for i in range(0, len(tasks), max_concurrent):
|
for i in range(0, len(tasks), max_concurrent):
|
||||||
@ -199,6 +201,7 @@ class IndexStoreBase(ABC):
|
|||||||
batch_results = await asyncio.gather(*batch, return_exceptions=True)
|
batch_results = await asyncio.gather(*batch, return_exceptions=True)
|
||||||
results.extend(batch_results)
|
results.extend(batch_results)
|
||||||
return results
|
return results
|
||||||
|
|
||||||
def similar_search(
|
def similar_search(
|
||||||
self, text: str, topk: int, filters: Optional[MetadataFilters] = None
|
self, text: str, topk: int, filters: Optional[MetadataFilters] = None
|
||||||
) -> List[Chunk]:
|
) -> List[Chunk]:
|
||||||
|
Loading…
Reference in New Issue
Block a user