Commit dc552d0
committed
gguf-py: handle numpy 2.0 byte-ordering changes
this commit fixes this error:
```python
Traceback (most recent call last):
File "/home/poweruser/python-goddamn-venv/bin/gguf-dump", line 8, in <module>
sys.exit(gguf_dump_entrypoint())
^^^^^^^^^^^^^^^^^^^^^^
File "/home/poweruser/python-goddamn-venv/lib/python3.12/site-packages/gguf/scripts/gguf_dump.py", line 450, in main
dump_metadata(reader, args)
File "/home/poweruser/python-goddamn-venv/lib/python3.12/site-packages/gguf/scripts/gguf_dump.py", line 35, in dump_metadata
host_endian, file_endian = get_file_host_endian(reader)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/poweruser/python-goddamn-venv/lib/python3.12/site-packages/gguf/scripts/gguf_dump.py", line 24, in get_file_host_endian
host_endian = 'LITTLE' if np.uint32(1) == np.uint32(1).newbyteorder("<") else 'BIG'
^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: newbyteorder was removed from scalar types in NumPy 2.0. Use sc.view(sc.dtype.newbyteorder(order)) instead.
```1 parent 6dde178 commit dc552d0
1 file changed
+3
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
0 commit comments