aboutsummaryrefslogtreecommitdiffstats
path: root/modules/safe.py
diff options
context:
space:
mode:
authorcatalpaaa <89681913+catalpaaa@users.noreply.github.com>2023-05-01 18:59:21 +0000
committerGitHub <noreply@github.com>2023-05-01 18:59:21 +0000
commit9eb5b3e90f1775af81c828f19e7caded70ba8884 (patch)
tree4630848311b90277462842669274852f7f6a972a /modules/safe.py
parentecdc6471e7d694ef9ecec96e8c3128237efe069a (diff)
parent72cd27a13587c9579942577e9e3880778be195f6 (diff)
downloadstable-diffusion-webui-gfx803-9eb5b3e90f1775af81c828f19e7caded70ba8884.tar.gz
stable-diffusion-webui-gfx803-9eb5b3e90f1775af81c828f19e7caded70ba8884.tar.bz2
stable-diffusion-webui-gfx803-9eb5b3e90f1775af81c828f19e7caded70ba8884.zip
Merge branch 'experimental' into subpath-support
Diffstat (limited to 'modules/safe.py')
-rw-r--r--modules/safe.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/modules/safe.py b/modules/safe.py
index 82d44be3..dadf319c 100644
--- a/modules/safe.py
+++ b/modules/safe.py
@@ -1,6 +1,5 @@
# this code is adapted from the script contributed by anon from /h/
-import io
import pickle
import collections
import sys
@@ -12,11 +11,9 @@ import _codecs
import zipfile
import re
-
# PyTorch 1.13 and later have _TypedStorage renamed to TypedStorage
TypedStorage = torch.storage.TypedStorage if hasattr(torch.storage, 'TypedStorage') else torch.storage._TypedStorage
-
def encode(*args):
out = _codecs.encode(*args)
return out
@@ -27,7 +24,7 @@ class RestrictedUnpickler(pickle.Unpickler):
def persistent_load(self, saved_id):
assert saved_id[0] == 'storage'
- return TypedStorage()
+ return TypedStorage(_internal=True)
def find_class(self, module, name):
if self.extra_handler is not None: