Merge pull request #5 from swanserquack/fix_vocab_encoding

Fix inability to load vocab.json on converting the 16B model due to encoding of the file not being set
This commit is contained in:
James Ravenscroft 2023-04-12 20:50:33 +01:00 committed by GitHub
commit 5d2ea0a841
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -59,7 +59,7 @@ if len(sys.argv) < 3:
dir_model = sys.argv[1]
fname_out = sys.argv[1] + "/ggml-model.bin"
with open(dir_model + "/vocab.json", "r") as f:
with open(dir_model + "/vocab.json", "r", encoding="utf8") as f:
encoder = json.load(f)
with open(dir_model + "/added_tokens.json", "r") as f: