Update gguf-py/gguf/gguf_writer.py

Co-authored-by: compilade <git@compilade.net>
This commit is contained in:
Christian Zhou-Zheng 2024-06-09 20:17:25 -04:00 committed by GitHub
parent 1e2d9cb589
commit f7e7983946
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -167,10 +167,10 @@ class GGUFWriter:
self.add_shard_kv_data() self.add_shard_kv_data()
for fout, tensors, kv_data in zip(self.fout, self.tensors, self.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) fout.write(self._pack("<I", GGUF_MAGIC, skip_pack_prefix = True))
self._write_packed(fout, "I", GGUF_VERSION) fout.write(self._pack("I", GGUF_VERSION))
self._write_packed(fout, "Q", len(tensors)) fout.write(self._pack("Q", len(tensors)))
self._write_packed(fout, "Q", len(kv_data)) fout.write(self._pack("Q", len(kv_data)))
fout.flush() fout.flush()
self.state = WriterState.HEADER self.state = WriterState.HEADER