From 3b67ff808a93b95f349890a13f2cfc62dc1988fb Mon Sep 17 00:00:00 2001 From: toyer <2042519524@qq.com> Date: Tue, 25 Jun 2024 02:22:55 +0000 Subject: [PATCH] fix code style --- convert-hf-to-gguf.py | 2 +- gguf-py/gguf/constants.py | 2 +- gguf-py/gguf/gguf_writer.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index b56bb8afc..97b02f619 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -2895,6 +2895,7 @@ class T5Model(Model): return [(self.map_tensor_name(name), data_torch)] + @Model.register("ChatGLMModel") class ChatGLMModel(Model): model_arch = gguf.MODEL_ARCH.CHATGLM @@ -3081,7 +3082,6 @@ class ChatGLMModel(Model): return [(self.map_tensor_name(name), data_torch)] - ###### CONVERSION LOGIC ###### diff --git a/gguf-py/gguf/constants.py b/gguf-py/gguf/constants.py index 33e6463c5..d08d154ad 100644 --- a/gguf-py/gguf/constants.py +++ b/gguf-py/gguf/constants.py @@ -119,7 +119,6 @@ class Keys: EOS_ID_LIST = "tokenizer.ggml.eos_token_id_list" - # # recommended mapping of model tensor names for storage in gguf # @@ -164,6 +163,7 @@ class MODEL_ARCH(IntEnum): BITNET = auto() T5 = auto() + class MODEL_TENSOR(IntEnum): TOKEN_EMBD = auto() TOKEN_EMBD_NORM = auto() diff --git a/gguf-py/gguf/gguf_writer.py b/gguf-py/gguf/gguf_writer.py index e5ad3c76e..b7bbaeee2 100644 --- a/gguf-py/gguf/gguf_writer.py +++ b/gguf-py/gguf/gguf_writer.py @@ -608,7 +608,7 @@ class GGUFWriter: def add_bos_token_id(self, id: int) -> None: self.add_uint32(Keys.Tokenizer.BOS_ID, id) - + def add_eos_token_id_list(self, id: Sequence[str] | Sequence[bytes] | Sequence[bytearray]) -> None: self.add_array(Keys.Tokenizer.EOS_ID_LIST, id)