From 5b5eaf3a81c355bcb8698531753fd42b5f10d38b Mon Sep 17 00:00:00 2001 From: Dustin Pfeiffer Date: Fri, 23 Feb 2024 15:28:01 -0800 Subject: [PATCH] don't delete loras_tags.json on JSONDecodeError --- utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils.py b/utils.py index 2120327..cde7380 100644 --- a/utils.py +++ b/utils.py @@ -66,7 +66,7 @@ def load_json_from_file(file_path): return None except json.JSONDecodeError: print(f"Error decoding JSON in file: {file_path}") - return None + raise def save_dict_to_json(data_dict, file_path): try: @@ -219,4 +219,4 @@ def append_lora_name_if_empty(tags_list, lora_path, enabled): filename = os.path.basename(filename) tags_list.append(filename) - return tags_list \ No newline at end of file + return tags_list