This commit is contained in:
saloui 2023-06-23 08:49:05 +02:00
parent 9d22a7b95f
commit bd58e00404
2 changed files with 17 additions and 8 deletions

View File

@ -315,13 +315,22 @@ class LoLLMsAPPI():
ASCIIColors.error(f"Personality file not found or is corrupted ({personality_path}).\nReturned the following exception:{ex}\nPlease verify that the personality you have selected exists or select another personality. Some updates may lead to change in personality name or category, so check the personality selection in settings to be sure.")
if self.config["debug"]:
print(ex)
personality = AIPersonality(
personality_path,
self.lollms_paths,
self.config,
self.model,
run_scripts=True,
installation_option=InstallOption.FORCE_INSTALL)
try:
personality = AIPersonality(
personality_path,
self.lollms_paths,
self.config,
self.model,
run_scripts=True,
installation_option=InstallOption.FORCE_INSTALL)
except:
ASCIIColors.error(f"Couldn't load personality at {personality_path}")
personality = AIPersonality(None, self.lollms_paths,
self.config,
self.model,
run_scripts=True,
installation_option=InstallOption.FORCE_INSTALL)
ASCIIColors.info("Reverted to default personality")
print(f'selected : {self.config["active_personality_id"]}')
ASCIIColors.success(f" ╔══════════════════════════════════════════════════╗ ")
ASCIIColors.success(f" ║ Done ║ ")

2
app.py
View File

@ -342,7 +342,7 @@ class LoLLMsWebUI(LoLLMsAPPI):
personality_info['description'] = config_data.get('personality_description',"")
personality_info['author'] = config_data.get('author', 'ParisNeo')
personality_info['version'] = config_data.get('version', '1.0.0')
personality_info['installed'] = (self.personality.lollms_paths.personal_configuration_path/f"personality_{personality_folder.stem}.yaml").exists()
personality_info['installed'] = (self.lollms_paths.personal_configuration_path/f"personality_{personality_folder.stem}.yaml").exists()
scripts_path = personality_folder / 'scripts'
personality_info['has_scripts'] = scripts_path.is_dir()
real_assets_path = personality_folder/ 'assets'