summaryrefslogtreecommitdiff
path: root/gguf.py
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2023-08-22 20:05:59 +0300
committerGitHub <noreply@github.com>2023-08-22 20:05:59 +0300
commitdeb7dfca4b9725cd295d1426db75fe8e0a6d5312 (patch)
treef36daf023af86b6005325cbb4ee80a7966255e59 /gguf.py
parentbac66994cf356cf488078c056831396eb4ce31d5 (diff)
gguf : add ftype meta info to the model (#2710)
* llama : add ftype meta info to the model ggml-ci * convert.py : add ftype when converting (does not work) * convert.py : fix Enum to IntEnum ggml-ci
Diffstat (limited to 'gguf.py')
-rw-r--r--gguf.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/gguf.py b/gguf.py
index 9776649c..46574671 100644
--- a/gguf.py
+++ b/gguf.py
@@ -26,6 +26,7 @@ KEY_GENERAL_DESCRIPTION = "general.description"
KEY_GENERAL_LICENSE = "general.license"
KEY_GENERAL_SOURCE_URL = "general.source.url"
KEY_GENERAL_SOURCE_HF_REPO = "general.source.hugginface.repository"
+KEY_GENERAL_FILE_TYPE = "general.file_type"
# LLM
KEY_LLM_CONTEXT_LENGTH = "{arch}.context_length"
@@ -595,6 +596,9 @@ class GGUFWriter:
def add_source_hf_repo(self, repo: str):
self.add_string(KEY_GENERAL_SOURCE_HF_REPO, repo)
+ def add_file_type(self, ftype: int):
+ self.add_uint32(KEY_GENERAL_FILE_TYPE, ftype)
+
def add_name(self, name: str):
self.add_string(KEY_GENERAL_NAME, name)