Skip to content

Commit

Permalink
models : change default encoding to utf8 (ggerganov#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamilake authored Mar 22, 2023
1 parent 4aa3bcf commit 992aa2c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions models/convert-h5-to-ggml.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ def bytes_to_unicode():
dir_whisper = sys.argv[2]
dir_out = sys.argv[3]

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:
with open(dir_model + "/added_tokens.json", "r", encoding="utf8") as f:
encoder_added = json.load(f)
with open(dir_model + "/config.json", "r") as f:
with open(dir_model + "/config.json", "r", encoding="utf8") as f:
hparams = json.load(f)

model = WhisperForConditionalGeneration.from_pretrained(dir_model)
Expand Down

0 comments on commit 992aa2c

Please sign in to comment.