mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-03 04:40:06 +06:00
Explicitly setting encoding in tokenization_utils_base.py (#38553)
Update tokenization_utils_base.py Add encoding explicitly
This commit is contained in:
parent
caf708da1b
commit
8cb96787a6
@ -2086,7 +2086,7 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
|
||||
chat_template_file = resolved_vocab_files.pop("chat_template_file", None)
|
||||
extra_chat_templates = [key for key in resolved_vocab_files if key.startswith("chat_template_")]
|
||||
if chat_template_file is not None:
|
||||
with open(chat_template_file) as chat_template_handle:
|
||||
with open(chat_template_file, encoding="utf-8") as chat_template_handle:
|
||||
chat_templates["default"] = chat_template_handle.read()
|
||||
for extra_chat_template in extra_chat_templates:
|
||||
template_file = resolved_vocab_files.pop(extra_chat_template, None)
|
||||
|
Loading…
Reference in New Issue
Block a user