aboutsummaryrefslogtreecommitdiff
path: root/modules/safe.py
diff options
context:
space:
mode:
authorcatboxanon <122327233+catboxanon@users.noreply.github.com>2023-05-13 11:04:26 -0400
committerGitHub <noreply@github.com>2023-05-13 11:04:26 -0400
commitcb5f61281a95be72fc812b7d350b6ec23e2f9bdd (patch)
tree70e193c602cebd04b574b57a6aa2c351cb30c7f0 /modules/safe.py
parent2b3fc246b050f4649a643cfcaf16df60a9ac615a (diff)
Allow bf16 in safe unpickler
Diffstat (limited to 'modules/safe.py')
-rw-r--r--modules/safe.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/safe.py b/modules/safe.py
index 1e791c5b..e8f50774 100644
--- a/modules/safe.py
+++ b/modules/safe.py
@@ -40,7 +40,7 @@ class RestrictedUnpickler(pickle.Unpickler):
return getattr(collections, name)
if module == 'torch._utils' and name in ['_rebuild_tensor_v2', '_rebuild_parameter', '_rebuild_device_tensor_from_numpy']:
return getattr(torch._utils, name)
- if module == 'torch' and name in ['FloatStorage', 'HalfStorage', 'IntStorage', 'LongStorage', 'DoubleStorage', 'ByteStorage', 'float32']:
+ if module == 'torch' and name in ['FloatStorage', 'HalfStorage', 'IntStorage', 'LongStorage', 'DoubleStorage', 'ByteStorage', 'float32', 'BFloat16Storage']:
return getattr(torch, name)
if module == 'torch.nn.modules.container' and name in ['ParameterDict']:
return getattr(torch.nn.modules.container, name)