Skip to content

special_tokens, 'list' object has no attribute 'keys' #47110

Description

@Ratinax

System Info

In tokenization_utils_base.py line 1190, there is a special_tokens.keys() done. But special_tokens is typed as List[str].

And when using it, I have special_tokens being equal to ['<s>NOTUSED', '</s>NOTUSED', '<unk>NOTUSED'] this lead to the error 'list' object has no attribute 'keys'

Who can help?

No response

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

use AutoTokenizer.from_pretrained(model_path) with a valid model_path and a valid content

Expected behavior

not raising an error and working

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions