Skip to content

Commit a3bc638

Browse files
committed
replace addition_special_tokens with extra_special_tokens
Signed-off-by: Yash Mehan <yashmehan@gmail.com>
1 parent b749727 commit a3bc638

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

tests/utils/test_embedding_resize.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ def test_special_tokens_before_and_after():
128128
model = AutoModelForCausalLM.from_pretrained(MODEL_NAME)
129129

130130
input_tokenizer_len = len(tokenizer.get_vocab())
131-
addn_spl_tokens_before = tokenizer.special_tokens_map.get(
132-
"additional_special_tokens"
133-
)
131+
# addn_spl_tokens_before = tokenizer.special_tokens_map.get(
132+
# "additional_special_tokens"
133+
# )
134+
addn_spl_tokens_before = list(tokenizer.extra_special_tokens)
134135
assert (
135136
len(addn_spl_tokens_before) > 0
136137
), "this test needs tokenizer special tokens to not be empty before testing"
@@ -150,9 +151,10 @@ def test_special_tokens_before_and_after():
150151
addn_spl_tokens_before.extend(addn_spl_tokens_added)
151152
expected_addn_special_tokens = addn_spl_tokens_before
152153
expected_embedding_size = input_tokenizer_len + len(addn_spl_tokens_added) + 2
153-
addn_spl_tokens_after = tokenizer.special_tokens_map.get(
154-
"additional_special_tokens"
155-
)
154+
# addn_spl_tokens_after = tokenizer.special_tokens_map.get(
155+
# "additional_special_tokens"
156+
# )
157+
addn_spl_tokens_after = list(tokenizer.extra_special_tokens)
156158

157159
assert "<SEP>" in tokenizer.get_vocab()
158160
assert "<PAD>" in tokenizer.get_vocab()

0 commit comments

Comments
 (0)