aboutsummaryrefslogtreecommitdiff
path: root/convert-ggml-to-pth.py
diff options
context:
space:
mode:
Diffstat (limited to 'convert-ggml-to-pth.py')
-rw-r--r--convert-ggml-to-pth.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/convert-ggml-to-pth.py b/convert-ggml-to-pth.py
index 20158c9..8ab1741 100644
--- a/convert-ggml-to-pth.py
+++ b/convert-ggml-to-pth.py
@@ -84,6 +84,11 @@ def read_variables(fin):
shape = shape[::-1]
name = fin.read(name_length).decode("utf-8")
+ # ensure tensor data is aligned
+ tensor_data_offset = fin.tell()
+ tensor_data_offset = (tensor_data_offset + 31) & -32
+ fin.seek(tensor_data_offset)
+
if ftype_cur == 2:
# 4-bit quantized weights
dtype = np.uint8