From 992aa2cd1b328d8beb6ae7bd368f37d128df5647 Mon Sep 17 00:00:00 2001 From: Kamilake Date: Thu, 23 Mar 2023 04:17:24 +0900 Subject: [PATCH] models : change default encoding to utf8 (#605) --- models/convert-h5-to-ggml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/models/convert-h5-to-ggml.py b/models/convert-h5-to-ggml.py index b06ad23d..3ddee220 100644 --- a/models/convert-h5-to-ggml.py +++ b/models/convert-h5-to-ggml.py @@ -79,11 +79,11 @@ dir_model = sys.argv[1] 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)