purge bad personalities

This commit is contained in:
saloui 2023-06-20 12:40:04 +02:00
parent b1242ed540
commit 5dcaa7be10

8
app.py
View File

@ -311,9 +311,13 @@ class LoLLMsWebUI(LoLLMsAPPI):
for personality_folder in category_folder.iterdir():
pers = personality_folder.stem
if personality_folder.is_dir():
personality_info = {"folder":personality_folder.stem}
config_path = personality_folder / 'config.yaml'
if not config_path.exists():
config_path.parent.unlink(missing_ok=True)
ASCIIColors.warning(f"Deleted useless personality: {config_path.parent}")
continue
try:
personality_info = {"folder":personality_folder.stem}
config_path = personality_folder / 'config.yaml'
with open(config_path) as config_file:
config_data = yaml.load(config_file, Loader=yaml.FullLoader)
personality_info['name'] = config_data.get('name',"No Name")