Skip to content

Commit

Permalink
Merge pull request #58 from r0y6a3n0/master
Browse files Browse the repository at this point in the history
fix decode missing token issue
  • Loading branch information
ggerganov authored Oct 17, 2022
2 parents 0ad085f + 949f97a commit f24d940
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion convert-pt-to-ggml.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ def bytes_to_unicode():
fout.write(struct.pack("i", len(tokens)))

for key in tokens:
text = bytearray([byte_decoder[c] for c in key]).decode('utf-8', errors='replace').encode('utf-8')
text = bytearray([byte_decoder[c] for c in key])
fout.write(struct.pack("i", len(text)))
fout.write(text)

Expand Down

0 comments on commit f24d940

Please sign in to comment.