From: MoonRide303 Date: Tue, 18 Feb 2025 09:30:16 +0000 (+0100) Subject: scripts: corrected encoding when getting chat template (#11866) (#11907) X-Git-Tag: upstream/0.0.4853~116 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=5137da7b8c3eaa090476a632888ca178ba109f8a;p=pkg%2Fggml%2Fsources%2Fllama.cpp scripts: corrected encoding when getting chat template (#11866) (#11907) Signed-off-by: MoonRide303 --- diff --git a/scripts/get_chat_template.py b/scripts/get_chat_template.py index d8143e40..b4827b31 100755 --- a/scripts/get_chat_template.py +++ b/scripts/get_chat_template.py @@ -21,7 +21,7 @@ def get_chat_template(model_id, variant=None): # Use huggingface_hub library if available. # Allows access to gated models if the user has access and ran `huggingface-cli login`. from huggingface_hub import hf_hub_download - with open(hf_hub_download(repo_id=model_id, filename="tokenizer_config.json")) as f: + with open(hf_hub_download(repo_id=model_id, filename="tokenizer_config.json"), encoding="utf-8") as f: config_str = f.read() except ImportError: import requests