From a1e9e73011727c22e82f380b79d2aaa585e5df5f Mon Sep 17 00:00:00 2001 From: Saifeddine ALOUI Date: Sun, 27 Aug 2023 21:35:43 +0200 Subject: [PATCH] fixed presets problem --- app.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 42452084..bbb77ec0 100644 --- a/app.py +++ b/app.py @@ -493,11 +493,15 @@ class LoLLMsWebUI(LoLLMsAPPI): shutil.copy2(src_file, dest_file) def get_presets(self): - presets_folder = self.lollms_paths.personal_databases_path/"lollms_playground_presets" - if not presets_folder.exists(): - presets_folder.mkdir(exist_ok=True, parents=True) - self.copy_files("presets",presets_folder) presets = [] + presets_folder = Path("__file__").parent/"presets" + for filename in presets_folder.glob('*.yaml'): + with open(filename, 'r', encoding='utf-8') as file: + preset = yaml.safe_load(file) + if preset is not None: + presets.append(preset) + presets_folder = self.lollms_paths.personal_databases_path/"lollms_playground_presets" + presets_folder.mkdir(exist_ok=True, parents=True) for filename in presets_folder.glob('*.yaml'): with open(filename, 'r', encoding='utf-8') as file: preset = yaml.safe_load(file)