Skip to content

Commit

Permalink
gguf : fix "general.alignment" type in gguf_reader.py (ggerganov#5136)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowyu authored Jan 26, 2024
1 parent aad0b01 commit 38b431d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gguf-py/gguf/gguf_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def __init__(self, path: os.PathLike[str] | str, mode: Literal['r' | 'r+' | 'c']
offs, tensors_fields = self._build_tensors_fields(offs, tensor_count)
new_align = self.fields.get('general.alignment')
if new_align is not None:
if new_align.types != [GGUFValueType.UINT64]:
if new_align.types != [GGUFValueType.UINT32]:
raise ValueError('Bad type for general.alignment field')
self.alignment = new_align.parts[-1][0]
padding = offs % self.alignment
Expand Down

0 comments on commit 38b431d

Please sign in to comment.