Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandros Koumparoulis <[email protected]>
  • Loading branch information
akoumpa committed Jan 6, 2025
1 parent a895489 commit b9494cc
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tests/collections/nlp/test_tokenizer_with_special_tokens.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@
# limitations under the License.


import pytest

from nemo.collections.nlp.modules.common.tokenizer_utils import get_nmt_tokenizer

TOKENIZER_SPM_FILE = '/home/TestData/nlp/tokenizer_with_special_tokens/tokenizer.model'
Expand Down Expand Up @@ -42,5 +40,6 @@ def test_spm_with_special_tokens() -> None:
)

assert tokenizer.text_to_ids('[INST]') == [3]
for special_token in special_tokens:
assert special_token in tokenizer.special_token_to_id, f'Expected {special_token} to be a special token'
for i, special_token in enumerate(special_tokens):
assert special_token in tokenizer.special_token_to_id, f'Expected {special_token} to be a special token'
assert tokenizer.special_token_to_id[special_token] == i + 1

0 comments on commit b9494cc

Please sign in to comment.