summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKerfuffle <44031344+KerfuffleV2@users.noreply.github.com>2023-08-21 18:01:34 -0600
committerGitHub <noreply@github.com>2023-08-21 18:01:34 -0600
commit930523c8e1cbbee5449c055daa894917fac6805e (patch)
tree32cd47030e0d3c86f0731f3ac989757e92973a77
parentc8dba409e6d6a754090f08e6a862c5ffdd52e421 (diff)
Fix convert-llama-ggmlv3-to-gguf.py vocab conversion (#2698)
When converting without metadata, the hex value for bytes entries weren't 0 padded to 2 digits.
-rw-r--r--convert-llama-ggmlv3-to-gguf.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/convert-llama-ggmlv3-to-gguf.py b/convert-llama-ggmlv3-to-gguf.py
index 30038072..fa4a044c 100644
--- a/convert-llama-ggmlv3-to-gguf.py
+++ b/convert-llama-ggmlv3-to-gguf.py
@@ -236,8 +236,7 @@ class GGMLToGGUF:
if len(vbytes) == 0:
tt = 3 # Control
elif tokid >= 3 and tokid <= 258 and len(vbytes) == 1:
- hv = hex(vbytes[0])[2:].upper()
- vbytes = bytes(f'<0x{hv}>', encoding = 'UTF-8')
+ vbytes = bytes(f'<0x{vbytes[0]:02X}>', encoding = 'UTF-8')
tt = 6 # Byte
else:
vbytes = vbytes.replace(b' ', b'\xe2\x96\x81')