diff options
author | Hamdoud Hakem <90524568+hamdoudhakem@users.noreply.github.com> | 2024-06-20 20:59:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-20 21:59:59 +0200 |
commit | 17b291a6a581c47f24f99bad926b42617894f99f (patch) | |
tree | 59ddac257aab7906b31127c9ca4d40375768921b | |
parent | abd894ad96a242043b8e197ec130d8649eead22e (diff) |
convert-hf : Fix the encoding in the convert-hf-to-gguf-update.py (#8040)
-rwxr-xr-x | convert-hf-to-gguf-update.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/convert-hf-to-gguf-update.py b/convert-hf-to-gguf-update.py index fbf1e1ea..67598b56 100755 --- a/convert-hf-to-gguf-update.py +++ b/convert-hf-to-gguf-update.py @@ -214,7 +214,7 @@ src_func = f""" """ convert_py_pth = pathlib.Path("convert-hf-to-gguf.py") -convert_py = convert_py_pth.read_text() +convert_py = convert_py_pth.read_text(encoding="utf-8") convert_py = re.sub( r"(# Marker: Start get_vocab_base_pre)(.+?)( +# Marker: End get_vocab_base_pre)", lambda m: m.group(1) + src_func + m.group(3), @@ -222,7 +222,7 @@ convert_py = re.sub( flags=re.DOTALL | re.MULTILINE, ) -convert_py_pth.write_text(convert_py) +convert_py_pth.write_text(convert_py, encoding="utf-8") logger.info("+++ convert-hf-to-gguf.py was updated") |