"...resnet50_tensorflow.git" did not exist on "8fa62b84464fbb464d8e9e01fbf485e2d51f4e7a"
Commit 2c12464a authored by dchurchwell's avatar dchurchwell Committed by Lysandre Debut
Browse files

Changed vocabulary save function. Variable name was inconsistent, causing an...

Changed vocabulary save function. Variable name was inconsistent, causing an error to be thrown when passing a file name instead of a directory.
parent 6fc3d34a
...@@ -159,6 +159,8 @@ class TransfoXLTokenizer(PreTrainedTokenizer): ...@@ -159,6 +159,8 @@ class TransfoXLTokenizer(PreTrainedTokenizer):
"""Save the tokenizer vocabulary to a directory or file.""" """Save the tokenizer vocabulary to a directory or file."""
if os.path.isdir(vocab_path): if os.path.isdir(vocab_path):
vocab_file = os.path.join(vocab_path, VOCAB_FILES_NAMES["pretrained_vocab_file"]) vocab_file = os.path.join(vocab_path, VOCAB_FILES_NAMES["pretrained_vocab_file"])
else:
vocab_file = vocab_path
torch.save(self.__dict__, vocab_file) torch.save(self.__dict__, vocab_file)
return (vocab_file,) return (vocab_file,)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment