From 8332d26123252a9a1c48714b3a2cd8c85ce292d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Yusuf=20Sar=C4=B1g=C3=B6z?= Date: Thu, 27 Jul 2023 09:48:08 +0300 Subject: [PATCH] refactor: reduce code duplication and better API --- gguf.py | 57 +++++++++++++++++++++++++-------------------------------- 1 file changed, 25 insertions(+), 32 deletions(-) diff --git a/gguf.py b/gguf.py index dfd5ba5bf..991bbe2f3 100644 --- a/gguf.py +++ b/gguf.py @@ -71,63 +71,56 @@ class GGUFWriter: f = open(path, "wb") return cls(f) - def write_key(self, key: str, value_type: GGUFValueType): - encoded_key = key.encode("utf8") - self.buffered_writer.write(struct.pack("