handle duplicate extensions and redo exception handler

This commit is contained in:
Vladimir Mandic
2023-04-14 09:57:53 -04:00
parent f9818e93d8
commit 2ece9782e4
28 changed files with 161 additions and 212 deletions
+5 -6
View File
@@ -11,7 +11,7 @@ import torch
import tqdm
from einops import rearrange, repeat
from ldm.util import default
from modules import devices, processing, sd_models, shared, sd_samplers, hashes, sd_hijack_checkpoint
from modules import devices, processing, sd_models, shared, sd_samplers, hashes, sd_hijack_checkpoint, errors
from modules.textual_inversion import textual_inversion, logging
from modules.textual_inversion.learn_schedule import LearnRateScheduler
from torch import einsum
@@ -329,9 +329,8 @@ def load_hypernetwork(name):
try:
hypernetwork.load(path)
except Exception:
print(f"Error loading hypernetwork {path}", file=sys.stderr)
shared.exception()
except Exception as e:
errors.display(e, f'hypernetwork load: {path}')
return None
return hypernetwork
@@ -769,8 +768,8 @@ Last saved hypernetwork: {html.escape(last_saved_file)}<br/>
Last saved image: {html.escape(last_saved_image)}<br/>
</p>
"""
except Exception:
shared.exception()
except Exception as e:
errors.display(e, 'hypernetwork train')
finally:
pbar.leave = False
pbar.close()