feat: Show new chunk count when adding a dataset (#207)

This commit is contained in:
cachho
2023-07-10 13:11:12 +02:00
committed by GitHub
parent feda6b347a
commit 13bac72e25

View File

@@ -102,12 +102,14 @@ class EmbedChain:
ids = list(data_dict.keys())
documents, metadatas = zip(*data_dict.values())
chunks_before_addition = self.count()
self.collection.add(
documents=documents,
metadatas=list(metadatas),
ids=ids
)
print(f"Successfully saved {src}. Total chunks count: {self.collection.count()}")
print(f"Successfully saved {src}. New chunks count: {self.count() - chunks_before_addition}")
def _format_result(self, results):
return [