From 319ab9d18c40d7bf0d73660ee46dfcfd51057fc0 Mon Sep 17 00:00:00 2001 From: vincent Date: Tue, 6 Feb 2024 07:27:15 +0800 Subject: [PATCH] fix for flake8 lint --- convert-hf-to-gguf.py | 4 ++++ gguf-py/gguf/constants.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index 704a6d777..829d68368 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -24,6 +24,7 @@ import gguf from convert import HfVocab + # check for any of the given keys in the dictionary and return the value of the first key found def get_key_opts(d, keys): for k in keys: @@ -1070,6 +1071,7 @@ class MixtralModel(Model): def set_vocab(self): self._set_vocab_sentencepiece() + class MiniCPMModel(Model): def set_gguf_parameters(self): block_count = self.hparams["num_hidden_layers"] @@ -1083,9 +1085,11 @@ class MiniCPMModel(Model): self.gguf_writer.add_layer_norm_rms_eps(self.hparams["rms_norm_eps"]) self.gguf_writer.add_file_type(self.ftype) self.gguf_writer.add_rope_dimension_count(self.hparams["hidden_size"] // self.hparams["num_attention_heads"]) + def set_vocab(self): self._set_vocab_hf() + class QwenModel(Model): @staticmethod def token_bytes_to_string(b): diff --git a/gguf-py/gguf/constants.py b/gguf-py/gguf/constants.py index bc552e6b3..1cfd41c0b 100644 --- a/gguf-py/gguf/constants.py +++ b/gguf-py/gguf/constants.py @@ -466,7 +466,7 @@ MODEL_TENSORS: dict[MODEL_ARCH, list[MODEL_TENSOR]] = { MODEL_TENSOR.FFN_DOWN, MODEL_TENSOR.FFN_UP, ], - MODEL_ARCH.MINICPM: [ + MODEL_ARCH.MINICPM: [ MODEL_TENSOR.TOKEN_EMBD, MODEL_TENSOR.OUTPUT_NORM, MODEL_TENSOR.ROPE_FREQS,