diff options
author | AUTOMATIC1111 <16777216c@gmail.com> | 2023-05-13 19:45:18 +0300 |
---|---|---|
committer | AUTOMATIC <16777216c@gmail.com> | 2023-05-13 20:21:39 +0300 |
commit | 063848798c4d4df6d3e108f4cc00c35ca38f5ebd (patch) | |
tree | 69406831ec4ed1b3605fa90bdaad732a63a62694 | |
parent | 7e3539df6f4e3979e080ed5d76faa3649c10f76f (diff) |
Merge pull request #10339 from catboxanon/bf16
Allow bf16 in safe unpickler
-rw-r--r-- | modules/safe.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/safe.py b/modules/safe.py index e6c2f2c0..e1a67f73 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)
|