Add trace two common errors to see if more info available

main
Trung Ngo 2022-12-10 23:52:39 -06:00
parent f8e422b44c
commit 1c3ab7a116
2 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import copy
from hashlib import md5
import json
import logging
import os
from modules import sd_samplers, shared, scripts, script_callbacks
from modules.script_callbacks import ImageSaveParams
@ -24,7 +25,7 @@ if platform.system() == "Windows" and not is_installed("pywin32"):
try:
from tools.add_tags import tag_files
except:
print(f"{extension_name}: Unable to load Windows tagging script from tools directory")
logging.exception(f"{extension_name}: Unable to load Windows tagging script from tools directory")
tag_files = None
state_name = "sac+logos+ava1-l14-linearMSE.pth"

View File

@ -1,3 +1,4 @@
import logging
import platform
import sys
# requires pywin32 (See requirements.txt. Supports Windows only obviously)
@ -69,7 +70,7 @@ def tag_files(files_glob="", tags=[], remove_tags=[], remove_all_tags=False, fil
if ps is not None:
ps.Commit()
except:
print(f"{log_prefix}Unable to write tag or category for {file}")
logging.exception(f"{log_prefix}Unable to write tag or category for {file}")
parser = argparse.ArgumentParser()
parser.add_argument("-f", "--files-glob", type=str, default="", help="glob pattern to files to tag", required=True)