Skip to content

Commit 2a6b6c6

Browse files
wj-McatZeyuChenguoshengCS
authored
fix issue: #2387 to make tokenizer more robust (#2395)
* fix issue: #2387 * format code Co-authored-by: Zeyu Chen <[email protected]> Co-authored-by: Guo Sheng <[email protected]>
1 parent 0432c12 commit 2a6b6c6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

paddlenlp/transformers/tokenizer_utils_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1619,8 +1619,8 @@ def convert_added_tokens(obj):
16191619
# does include a vocab file path in it. However, if the vocab file
16201620
# path included in json does not exist, such as was deleted, to make
16211621
# it still work, use the vocab file under this dir.
1622-
elif not os.path.isfile(init_kwargs[args_name]) and os.path.isfile(
1623-
file_path):
1622+
elif not os.path.isfile(init_kwargs[args_name],
1623+
'') and os.path.isfile(file_path):
16241624
init_kwargs[args_name] = file_path
16251625
# TODO(guosheng): avoid reduplication of position args and key word args
16261626
tokenizer = cls(*init_args, **init_kwargs)

0 commit comments

Comments
 (0)