Skip to content

Commit 5137da7

Browse files
authored
scripts: corrected encoding when getting chat template (#11866) (#11907)
Signed-off-by: MoonRide303 <[email protected]>
1 parent 09aaf4f commit 5137da7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/get_chat_template.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_chat_template(model_id, variant=None):
2121
# Use huggingface_hub library if available.
2222
# Allows access to gated models if the user has access and ran `huggingface-cli login`.
2323
from huggingface_hub import hf_hub_download
24-
with open(hf_hub_download(repo_id=model_id, filename="tokenizer_config.json")) as f:
24+
with open(hf_hub_download(repo_id=model_id, filename="tokenizer_config.json"), encoding="utf-8") as f:
2525
config_str = f.read()
2626
except ImportError:
2727
import requests

0 commit comments

Comments
 (0)