Skip to content

Commit 37a40df

Browse files
committed
format
1 parent 0e89b27 commit 37a40df

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/transformers/models/bartpho/tokenization_bartpho.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,9 @@ def __init__(
160160

161161
# Keep order of special tokens for backward compatibility
162162
self.fairseq_tokens_to_ids = {
163-
token: token_id
163+
str(token): token_id
164164
for token_id, token in enumerate(
165-
dict.fromkeys(
166-
[str(bos_token), str(pad_token), str(eos_token), str(unk_token), str(sep_token), str(cls_token)]
167-
).keys()
165+
dict.fromkeys([bos_token, pad_token, eos_token, unk_token, sep_token, cls_token]).keys()
168166
)
169167
}
170168
with open(monolingual_vocab_file, "r", encoding="utf-8") as f:

0 commit comments

Comments
 (0)