From 6d24a9f52e4b53c729e87b371fab49fc129a9d77 Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Mon, 22 Jul 2024 16:45:52 +0200 Subject: [PATCH] Update discussions_database.py --- lollms/databases/discussions_database.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lollms/databases/discussions_database.py b/lollms/databases/discussions_database.py index d2c628d..a9e52e4 100644 --- a/lollms/databases/discussions_database.py +++ b/lollms/databases/discussions_database.py @@ -670,11 +670,14 @@ class Discussion: if len(self.vectorizer.list_documents())==0 and len(self.text_files)>0: for path in self.text_files: - data = TextDocumentsLoader.read_file(path) try: - self.vectorizer.add_document(path.stem, data, path, True) + data = TextDocumentsLoader.read_file(path) + try: + self.vectorizer.add_document(path.stem, data, path, True) + except Exception as ex: + trace_exception(ex) except Exception as ex: - trace_exception(ex) + trace_exception(ex) try: self.vectorizer.index() except Exception as ex: