gguf.py : dont add empty strings

This commit is contained in:
klosax
2023-08-14 11:22:06 +02:00
committed by GitHub
parent a7d226f871
commit 5c5a95ba2d

View File

@@ -114,6 +114,7 @@ class GGUFWriter:
self.add_val(val, GGUFValueType.BOOL) self.add_val(val, GGUFValueType.BOOL)
def add_string(self, key: str, val: str): def add_string(self, key: str, val: str):
if len(val) == 0: return
self.add_key(key) self.add_key(key)
self.add_val(val, GGUFValueType.STRING) self.add_val(val, GGUFValueType.STRING)