make save_pretrained work with added tokens
right now it's dumping the *decoder* when it should be dumping the *encoder*. this fixes that.
This commit is contained in:
@@ -266,7 +266,7 @@ class PreTrainedTokenizer(object):
|
|||||||
|
|
||||||
with open(added_tokens_file, 'w', encoding='utf-8') as f:
|
with open(added_tokens_file, 'w', encoding='utf-8') as f:
|
||||||
if self.added_tokens_encoder:
|
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:
|
else:
|
||||||
out_str = u"{}"
|
out_str = u"{}"
|
||||||
f.write(out_str)
|
f.write(out_str)
|
||||||
|
|||||||
Reference in New Issue
Block a user