mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2025-01-29 15:44:12 +00:00
purge bad personalities
This commit is contained in:
parent
b1242ed540
commit
5dcaa7be10
8
app.py
8
app.py
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user