mirror of
https://github.com/huggingface/transformers.git
synced 2025-07-31 02:02:21 +06:00
Merge pull request #893 from joelgrus/patch-2
make save_pretrained do the right thing with added tokens
This commit is contained in:
commit
c244562cae
@ -266,7 +266,7 @@ class PreTrainedTokenizer(object):
|
||||
|
||||
with open(added_tokens_file, 'w', encoding='utf-8') as f:
|
||||
if self.added_tokens_encoder:
|
||||
out_str = json.dumps(self.added_tokens_decoder, ensure_ascii=False)
|
||||
out_str = json.dumps(self.added_tokens_encoder, ensure_ascii=False)
|
||||
else:
|
||||
out_str = u"{}"
|
||||
f.write(out_str)
|
||||
|
Loading…
Reference in New Issue
Block a user