]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
gguf-py: gguf_writer: Use bytearray to build metadata (#4051)
authorKerfuffle <redacted>
Sun, 12 Nov 2023 23:39:37 +0000 (16:39 -0700)
committerGitHub <redacted>
Sun, 12 Nov 2023 23:39:37 +0000 (16:39 -0700)
* gguf-py: gguf_writer: Use BytesIO to build metadata

* Use bytearray instead

Bump gguf-py package version

gguf-py/gguf/gguf_writer.py
gguf-py/pyproject.toml

index 75fb6976f9ca286b8db8548530023814a9e9e2e6..c3b8c588f17cdb10e3be2aafcc85af6bdbcd87fb 100644 (file)
@@ -57,9 +57,9 @@ class GGUFWriter:
         self.endianess = endianess
         self.offset_tensor = 0
         self.data_alignment = GGUF_DEFAULT_ALIGNMENT
-        self.kv_data = b""
+        self.kv_data = bytearray()
         self.kv_data_count = 0
-        self.ti_data = b""
+        self.ti_data = bytearray()
         self.ti_data_count = 0
         self.use_temp_file = use_temp_file
         self.temp_file = None
index e21c3cd94f22ae4f45ac633296b5e80c994b6ff7..af777c3e0f2b6c19978088ac9f50a38c8d06eb01 100644 (file)
@@ -1,6 +1,6 @@
 [tool.poetry]
 name = "gguf"
-version = "0.5.1"
+version = "0.5.2"
 description = "Read and write ML models in GGUF for GGML"
 authors = ["GGML <ggml@ggml.ai>"]
 packages = [