From d974aed5671e6a69a68348f17a926848c98490fe Mon Sep 17 00:00:00 2001 From: Georgi Gerganov Date: Sat, 4 May 2024 07:58:39 +0300 Subject: [PATCH] convert : print -> logging ggml-ci --- convert-hf-to-gguf-update.py | 32 ++++++++++++++++---------------- convert-hf-to-gguf.py | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/convert-hf-to-gguf-update.py b/convert-hf-to-gguf-update.py index 82a65fd7e..2b08b8505 100644 --- a/convert-hf-to-gguf-update.py +++ b/convert-hf-to-gguf-update.py @@ -159,8 +159,8 @@ src_func = f""" chktok = tokenizer.encode(chktxt) chkhsh = sha256(str(chktok).encode()).hexdigest() - print(f"chktok: {{chktok}}") - print(f"chkhsh: {{chkhsh}}") + logger.debug(f"chktok: {{chktok}}") + logger.debug(f"chkhsh: {{chkhsh}}") res = None @@ -169,22 +169,22 @@ src_func = f""" # don't edit the hashes manually! {src_ifs} if res is None: - print("\\n") - print("**************************************************************************************") - print("** WARNING: The BPE pre-tokenizer was not recognized!") - print("** There are 2 possible reasons for this:") - print("** - the model has not been added to convert-hf-to-gguf-update.py yet") - print("** - the pre-tokenization config has changed upstream") - print("** Check your model files and convert-hf-to-gguf-update.py and update them accordingly.") - print("** ref: https://github.com/ggerganov/llama.cpp/pull/6920") - print("**") - print(f"** chkhsh: {{chkhsh}}") - print("**************************************************************************************") - print("\\n") + logger.warning("\\n") + logger.warning("**************************************************************************************") + logger.warning("** WARNING: The BPE pre-tokenizer was not recognized!") + logger.warning("** There are 2 possible reasons for this:") + logger.warning("** - the model has not been added to convert-hf-to-gguf-update.py yet") + logger.warning("** - the pre-tokenization config has changed upstream") + logger.warning("** Check your model files and convert-hf-to-gguf-update.py and update them accordingly.") + logger.warning("** ref: https://github.com/ggerganov/llama.cpp/pull/6920") + logger.warning("**") + logger.warning(f"** chkhsh: {{chkhsh}}") + logger.warning("**************************************************************************************") + logger.warning("\\n") raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()") - print(f"tokenizer.ggml.pre: {{repr(res)}}") - print(f"chkhsh: {{chkhsh}}") + logger.debug(f"tokenizer.ggml.pre: {{repr(res)}}") + logger.debug(f"chkhsh: {{chkhsh}}") return res """ diff --git a/convert-hf-to-gguf.py b/convert-hf-to-gguf.py index f570e2c46..88c16676b 100755 --- a/convert-hf-to-gguf.py +++ b/convert-hf-to-gguf.py @@ -327,7 +327,7 @@ class Model(ABC): logger.warning("\n") raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()") - logger.debug(f"tokenizer.ggml.pre: {res}") + logger.debug(f"tokenizer.ggml.pre: {repr(res)}") logger.debug(f"chkhsh: {chkhsh}") return res