diff options
author | compilade <git@compilade.net> | 2024-05-24 21:11:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-25 11:11:48 +1000 |
commit | b83bab15a5d2a1e7807d09613a9b34309d86cfaa (patch) | |
tree | 449b4201f8b8929f674fc2ad7654406ba2c50a4b /gguf-py/scripts/gguf-new-metadata.py | |
parent | d041d2ceaaf50e058622d92921b3e680ffa4e9e7 (diff) |
gguf-py : fix and simplify quantized shape round-trip (#7483)
* gguf-py : fix and simplify quantized shape round-trip
* gguf-py : remove unused import
Diffstat (limited to 'gguf-py/scripts/gguf-new-metadata.py')
-rwxr-xr-x | gguf-py/scripts/gguf-new-metadata.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/gguf-py/scripts/gguf-new-metadata.py b/gguf-py/scripts/gguf-new-metadata.py index 63d3c5d8..c9f1927f 100755 --- a/gguf-py/scripts/gguf-new-metadata.py +++ b/gguf-py/scripts/gguf-new-metadata.py @@ -118,9 +118,7 @@ def copy_with_new_metadata(reader: gguf.GGUFReader, writer: gguf.GGUFWriter, new for tensor in reader.tensors: total_bytes += tensor.n_bytes - # Dimensions are written in reverse order, so flip them first - shape = np.flipud(tensor.shape).tolist() - writer.add_tensor_info(tensor.name, shape, tensor.data.dtype, tensor.data.nbytes, tensor.tensor_type) + writer.add_tensor_info(tensor.name, tensor.data.shape, tensor.data.dtype, tensor.data.nbytes, tensor.tensor_type) bar = tqdm(desc="Writing", total=total_bytes, unit="byte", unit_scale=True) |