Skip to content

[PretrainedTokenizer] is <unk> a special token? #4391

Description

@sshleifer

This confused me a lot as I was trying to add common tests for Marian.

I believe special_tokens_mask must return 0 for positions with unk_token_id, but <unk> is in SpecialTokensMixin.all_special_ids.

Relatedly, this RobertaTokenizer code suggests there should be a relationship between all_special_ids and special_token_mask logic.

Maybe <unk> shouldnt be in SpecialTokensMixin.all_special_ids?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions