mirror of
https://github.com/ParisNeo/lollms.git
synced 2024-12-21 05:33:12 +00:00
Update personality.py
This commit is contained in:
parent
cf44846659
commit
83633c1559
@ -534,10 +534,10 @@ Date: {{date}}
|
|||||||
try:
|
try:
|
||||||
self.vectorizer.remove_document(path)
|
self.vectorizer.remove_document(path)
|
||||||
if callback is not None:
|
if callback is not None:
|
||||||
callback("File added successfully",MSG_TYPE.MSG_TYPE_INFO)
|
callback("File removed successfully",MSG_TYPE.MSG_TYPE_INFO)
|
||||||
return True
|
return True
|
||||||
except ValueError as ve:
|
except ValueError as ve:
|
||||||
ASCIIColors.error(f"Unsupported file format. Supported formats are {GenericDataLoader.get_supported_file_types()}")
|
ASCIIColors.error(f"Couldn't remove the file")
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
self.vectorizer = None
|
self.vectorizer = None
|
||||||
@ -548,10 +548,10 @@ Date: {{date}}
|
|||||||
try:
|
try:
|
||||||
self.vectorizer.remove_document(path)
|
self.vectorizer.remove_document(path)
|
||||||
if callback is not None:
|
if callback is not None:
|
||||||
callback("File added successfully",MSG_TYPE.MSG_TYPE_INFO)
|
callback("File removed successfully",MSG_TYPE.MSG_TYPE_INFO)
|
||||||
return True
|
return True
|
||||||
except ValueError as ve:
|
except ValueError as ve:
|
||||||
ASCIIColors.error(f"Unsupported file format. Supported formats are {GenericDataLoader.get_supported_file_types()}")
|
ASCIIColors.error(f"Couldn't remove file")
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
self.vectorizer = None
|
self.vectorizer = None
|
||||||
@ -637,7 +637,7 @@ Date: {{date}}
|
|||||||
callback("File added successfully",MSG_TYPE.MSG_TYPE_INFO)
|
callback("File added successfully",MSG_TYPE.MSG_TYPE_INFO)
|
||||||
return True
|
return True
|
||||||
except ValueError as ve:
|
except ValueError as ve:
|
||||||
ASCIIColors.error(f"Unsupported file format. Supported formats are {GenericDataLoader.get_supported_file_types()}")
|
ASCIIColors.error(f"Unsupported file format or empty file.\nSupported formats are {GenericDataLoader.get_supported_file_types()}")
|
||||||
return False
|
return False
|
||||||
def save_personality(self, package_path=None):
|
def save_personality(self, package_path=None):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user