From 1198bb5320fd4f3edf83315110792b683a273cdb Mon Sep 17 00:00:00 2001 From: Paillat Date: Thu, 29 Feb 2024 17:31:13 +0100 Subject: [PATCH] Create presets file if not exists --- ui/gradio_ui.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/gradio_ui.py b/ui/gradio_ui.py index 1b5a423..b5edb92 100644 --- a/ui/gradio_ui.py +++ b/ui/gradio_ui.py @@ -15,6 +15,9 @@ class GenerateUI: """ def get_presets(self): + if not os.path.exists("local/presets.json"): + with open("local/presets.json", "w") as f: + f.write(orjson.dumps({})) with open("local/presets.json", "r") as f: return orjson.loads(f.read())