Commit 97bc0b95 authored by AUTOMATIC's avatar AUTOMATIC

do not stop working on failed hypernetwork load

parent d15b3ec0
import glob
import os
import sys
import traceback
import torch
from modules import devices
......@@ -36,8 +39,12 @@ def load_hypernetworks(path):
res = {}
for filename in glob.iglob(path + '**/*.pt', recursive=True):
hn = Hypernetwork(filename)
res[hn.name] = hn
try:
hn = Hypernetwork(filename)
res[hn.name] = hn
except Exception:
print(f"Error loading hypernetwork {filename}", file=sys.stderr)
print(traceback.format_exc(), file=sys.stderr)
return res
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment