From bdbb7417164088a045a6cdc924eda14e2a637329 Mon Sep 17 00:00:00 2001 From: JeLuF Date: Mon, 20 Feb 2023 22:44:10 +0100 Subject: [PATCH] Don't scan safetensors files In newer versions of the picklescanner, scanning of .safetensors files creates an error: 21:28:01.067 ERROR MainThread ERROR: parsing pickle in D:\2.35\dev\models\stable-diffusion\dantionrealmix_10.safetensors: at position 1, opcode b'\xce' unknown To avoid these entries in the logs, skip scanning of safetensors files. --- ui/easydiffusion/model_manager.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ui/easydiffusion/model_manager.py b/ui/easydiffusion/model_manager.py index 795eea73..116edf33 100644 --- a/ui/easydiffusion/model_manager.py +++ b/ui/easydiffusion/model_manager.py @@ -158,6 +158,8 @@ def make_model_folders(): def is_malicious_model(file_path): try: + if file_path.endswith(".safetensors"): + return False scan_result = scan_model(file_path) if scan_result.issues_count > 0 or scan_result.infected_files > 0: log.warn(