Update discussions_database.py

This commit is contained in:
Saifeddine ALOUI 2024-07-22 16:45:52 +02:00 committed by GitHub
parent 95ab717ca4
commit 6d24a9f52e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: