From 3cc41d043ed4080ffd38942cfc62fb44bd23dfb3 Mon Sep 17 00:00:00 2001 From: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> Date: Fri, 23 Sep 2022 12:58:15 -0400 Subject: [PATCH] Fix SIZES for torch tensors (#4) --- bindings/python/py_src/safetensors/torch.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bindings/python/py_src/safetensors/torch.py b/bindings/python/py_src/safetensors/torch.py index fa106db..8a44747 100644 --- a/bindings/python/py_src/safetensors/torch.py +++ b/bindings/python/py_src/safetensors/torch.py @@ -25,8 +25,12 @@ def save(tensors: Dict[str, torch.Tensor]) -> bytes: SIZE = { torch.bfloat16: 2, torch.float16: 2, + torch.float32: 4, + torch.uint8: 1, + torch.int8: 1, + torch.int16: 2, torch.int32: 4, - torch.int64: 4, + torch.int64: 8, } -- 2.43.0