Skip to content

Commit

Permalink
Update gguf-py/gguf/gguf_writer.py
Browse files Browse the repository at this point in the history
Co-authored-by: compilade <[email protected]>
  • Loading branch information
christianazinn and compilade authored Jun 10, 2024
1 parent 1e2d9cb commit f7e7983
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions gguf-py/gguf/gguf_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ def write_header_to_file(self, path: Path | None = None) -> None:
self.add_shard_kv_data()

for fout, tensors, kv_data in zip(self.fout, self.tensors, self.kv_data):
self._write_packed(fout, "<I", GGUF_MAGIC, skip_pack_prefix = True)
self._write_packed(fout, "I", GGUF_VERSION)
self._write_packed(fout, "Q", len(tensors))
self._write_packed(fout, "Q", len(kv_data))
fout.write(self._pack("<I", GGUF_MAGIC, skip_pack_prefix = True))
fout.write(self._pack("I", GGUF_VERSION))
fout.write(self._pack("Q", len(tensors)))
fout.write(self._pack("Q", len(kv_data)))
fout.flush()
self.state = WriterState.HEADER

Expand Down

0 comments on commit f7e7983

Please sign in to comment.