From 599ad7f95fa2e0155601ee4e145949041a725c45 Mon Sep 17 00:00:00 2001 From: bluelovers Date: Mon, 7 Aug 2023 09:54:10 +0800 Subject: [PATCH] fix: known_lora_hashes.txt https://github.com/DominikDoom/a1111-sd-webui-tagcomplete/issues/214 https://github.com/canisminor1990/sd-webui-lobe-theme/issues/324 --- scripts/model_keyword_support.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/model_keyword_support.py b/scripts/model_keyword_support.py index 4ce6416..43c8f38 100644 --- a/scripts/model_keyword_support.py +++ b/scripts/model_keyword_support.py @@ -28,9 +28,10 @@ def load_hash_cache(): def update_hash_cache(): global file_needs_update if file_needs_update: - with open(known_hashes_file, "w", encoding="utf-8") as file: + with open(known_hashes_file, "w", encoding="utf-8", newline='') as file: + writer = csv.writer(file) for name, (hash, mtime) in hash_dict.items(): - file.write(f'"{name}",{hash},{mtime}\n') + writer.writerow([name, hash, mtime]) # Copy of the fast inaccurate hash function from the extension