Skip to content

newbyteorder was removed from the ndarray class in NumPy 2.0. #7

Description

@leszekhanusz

I got the following error:

Error occurred when executing UnetLoaderGGUF:
`newbyteorder` was removed from the ndarray class in NumPy 2.0. Use `arr.view(arr.dtype.newbyteorder(order))` instead.
File "/mnt/tera/git-repos/ComfyUI/execution.py", line 152, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/tera/git-repos/ComfyUI/execution.py", line 82, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/tera/git-repos/ComfyUI/execution.py", line 75, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/tera/git-repos/ComfyUI/custom_nodes/ComfyUI-GGUF/nodes.py", line 53, in load_unet
sd = gguf_sd_loader(unet_path)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/tera/git-repos/ComfyUI/custom_nodes/ComfyUI-GGUF/nodes.py", line 19, in gguf_sd_loader
reader = gguf.GGUFReader(path)
^^^^^^^^^^^^^^^^^^^^^
File "/home/leszek/miniconda3/envs/comfyui/lib/python3.11/site-packages/gguf/gguf_reader.py", line 94, in __init__
if self._get(offs, np.uint32, override_order = '<')[0] != GGUF_MAGIC:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/leszek/miniconda3/envs/comfyui/lib/python3.11/site-packages/gguf/gguf_reader.py", line 151, in _get
.newbyteorder(override_order or self.byte_order)
^^^^^^^^^^^^

It seems to be this bug

As a very temporary workaround, you can simply delete the .newbyteorder(override_order or self.byte_order) line in site-packages/gguf/gguf_reader.py and it should work.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions