Skip to content

Commit

Permalink
Add support for I8, I16, I32 to gguf_reader
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed Mar 13, 2024
1 parent 4da095e commit b4d2c4d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions gguf-py/gguf/gguf_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,15 @@ def _build_tensors(self, start_offs: int, fields: list[ReaderField]) -> None:
elif ggml_type == GGMLQuantizationType.F16:
item_count = n_elems
item_type = np.float16
elif ggml_type == GGMLQuantizationType.I8:
item_count = n_elems
item_type = np.int8
elif ggml_type == GGMLQuantizationType.I16:
item_count = n_elems
item_type = np.int16
elif ggml_type == GGMLQuantizationType.I32:
item_count = n_elems
item_type = np.int32
else:
item_count = n_bytes
item_type = np.uint8
Expand Down

0 comments on commit b4d2c4d

Please sign in to comment.