aboutsummaryrefslogtreecommitdiffstats
path: root/modules/hypernetworks/hypernetwork.py
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-06-27 06:05:53 +0000
committerGitHub <noreply@github.com>2023-06-27 06:05:53 +0000
commit4147fd6b2f905f76c6bc20c3d9de2ea0842fa853 (patch)
treee7915af4d068912cd8509f1638e05460445a5eea /modules/hypernetworks/hypernetwork.py
parentf603275d84301b5ee952683e951dd1aad72ba615 (diff)
parentbedcd2f377a38ef4da58c11dbe222d32b954be2f (diff)
downloadstable-diffusion-webui-gfx803-4147fd6b2f905f76c6bc20c3d9de2ea0842fa853.tar.gz
stable-diffusion-webui-gfx803-4147fd6b2f905f76c6bc20c3d9de2ea0842fa853.tar.bz2
stable-diffusion-webui-gfx803-4147fd6b2f905f76c6bc20c3d9de2ea0842fa853.zip
Merge branch 'dev' into 10141-gradio-user-exif
Diffstat (limited to 'modules/hypernetworks/hypernetwork.py')
-rw-r--r--modules/hypernetworks/hypernetwork.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/modules/hypernetworks/hypernetwork.py b/modules/hypernetworks/hypernetwork.py
index 570b5603..5d12b449 100644
--- a/modules/hypernetworks/hypernetwork.py
+++ b/modules/hypernetworks/hypernetwork.py
@@ -2,8 +2,6 @@ import datetime
import glob
import html
import os
-import sys
-import traceback
import inspect
import modules.textual_inversion.dataset
@@ -11,7 +9,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
@@ -325,17 +323,14 @@ def load_hypernetwork(name):
if path is None:
return None
- hypernetwork = Hypernetwork()
-
try:
+ hypernetwork = Hypernetwork()
hypernetwork.load(path)
+ return hypernetwork
except Exception:
- print(f"Error loading hypernetwork {path}", file=sys.stderr)
- print(traceback.format_exc(), file=sys.stderr)
+ errors.report(f"Error loading hypernetwork {path}", exc_info=True)
return None
- return hypernetwork
-
def load_hypernetworks(names, multipliers=None):
already_loaded = {}
@@ -770,7 +765,7 @@ Last saved image: {html.escape(last_saved_image)}<br/>
</p>
"""
except Exception:
- print(traceback.format_exc(), file=sys.stderr)
+ errors.report("Exception in training hypernetwork", exc_info=True)
finally:
pbar.leave = False
pbar.close()