From 13bac72e25f2b3e1117743ea19c0d045d0f96516 Mon Sep 17 00:00:00 2001 From: cachho Date: Mon, 10 Jul 2023 13:11:12 +0200 Subject: [PATCH] feat: Show new chunk count when adding a dataset (#207) --- embedchain/embedchain.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/embedchain/embedchain.py b/embedchain/embedchain.py index ff4d94c1..c944ecfe 100644 --- a/embedchain/embedchain.py +++ b/embedchain/embedchain.py @@ -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 [