convert : print -> logging

ggml-ci
This commit is contained in:
Georgi Gerganov 2024-05-04 07:58:39 +03:00
parent 26f606efed
commit d974aed567
No known key found for this signature in database
GPG key ID: BF970631944C16B7
2 changed files with 17 additions and 17 deletions

View file

@ -159,8 +159,8 @@ src_func = f"""
chktok = tokenizer.encode(chktxt) chktok = tokenizer.encode(chktxt)
chkhsh = sha256(str(chktok).encode()).hexdigest() chkhsh = sha256(str(chktok).encode()).hexdigest()
print(f"chktok: {{chktok}}") logger.debug(f"chktok: {{chktok}}")
print(f"chkhsh: {{chkhsh}}") logger.debug(f"chkhsh: {{chkhsh}}")
res = None res = None
@ -169,22 +169,22 @@ src_func = f"""
# don't edit the hashes manually! # don't edit the hashes manually!
{src_ifs} {src_ifs}
if res is None: if res is None:
print("\\n") logger.warning("\\n")
print("**************************************************************************************") logger.warning("**************************************************************************************")
print("** WARNING: The BPE pre-tokenizer was not recognized!") logger.warning("** WARNING: The BPE pre-tokenizer was not recognized!")
print("** There are 2 possible reasons for this:") logger.warning("** There are 2 possible reasons for this:")
print("** - the model has not been added to convert-hf-to-gguf-update.py yet") logger.warning("** - the model has not been added to convert-hf-to-gguf-update.py yet")
print("** - the pre-tokenization config has changed upstream") logger.warning("** - the pre-tokenization config has changed upstream")
print("** Check your model files and convert-hf-to-gguf-update.py and update them accordingly.") logger.warning("** 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") logger.warning("** ref: https://github.com/ggerganov/llama.cpp/pull/6920")
print("**") logger.warning("**")
print(f"** chkhsh: {{chkhsh}}") logger.warning(f"** chkhsh: {{chkhsh}}")
print("**************************************************************************************") logger.warning("**************************************************************************************")
print("\\n") logger.warning("\\n")
raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()") raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()")
print(f"tokenizer.ggml.pre: {{repr(res)}}") logger.debug(f"tokenizer.ggml.pre: {{repr(res)}}")
print(f"chkhsh: {{chkhsh}}") logger.debug(f"chkhsh: {{chkhsh}}")
return res return res
""" """

View file

@ -327,7 +327,7 @@ class Model(ABC):
logger.warning("\n") logger.warning("\n")
raise NotImplementedError("BPE pre-tokenizer was not recognized - update get_vocab_base_pre()") 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}") logger.debug(f"chkhsh: {chkhsh}")
return res return res