The asyncio.as_completed() function does not guarantee that the results are ordered
This commit is contained in:
@@ -59,7 +59,7 @@ class MilvusVectorDBStorge(BaseVectorStorage):
|
|||||||
embedding_tasks = [self.embedding_func(batch) for batch in batches]
|
embedding_tasks = [self.embedding_func(batch) for batch in batches]
|
||||||
embeddings_list = []
|
embeddings_list = []
|
||||||
for f in tqdm_async(
|
for f in tqdm_async(
|
||||||
asyncio.as_completed(embedding_tasks),
|
await asyncio.gather(*embedding_tasks),
|
||||||
total=len(embedding_tasks),
|
total=len(embedding_tasks),
|
||||||
desc="Generating embeddings",
|
desc="Generating embeddings",
|
||||||
unit="batch",
|
unit="batch",
|
||||||
|
@@ -99,7 +99,7 @@ class NanoVectorDBStorage(BaseVectorStorage):
|
|||||||
embedding_tasks = [self.embedding_func(batch) for batch in batches]
|
embedding_tasks = [self.embedding_func(batch) for batch in batches]
|
||||||
embeddings_list = []
|
embeddings_list = []
|
||||||
for f in tqdm_async(
|
for f in tqdm_async(
|
||||||
asyncio.as_completed(embedding_tasks),
|
await asyncio.gather(*embedding_tasks),
|
||||||
total=len(embedding_tasks),
|
total=len(embedding_tasks),
|
||||||
desc="Generating embeddings",
|
desc="Generating embeddings",
|
||||||
unit="batch",
|
unit="batch",
|
||||||
|
Reference in New Issue
Block a user