transformers
e46ad22c - Improve type checker performance (#13094)

Comment changes are shownComment changes are hidden
Commit
3 years ago
Improve type checker performance (#13094) * conditional declare `TOKENIZER_MAPPING_NAMES` within a `if TYPE_CHECKING` block so that type checkers dont need to evaluate the RHS of the assignment. this improves performance of the pylance/pyright type checkers * Update src/transformers/models/auto/tokenization_auto.py Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com> * adding missing import * format Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
Author
Parents
  • src/transformers/models/auto
    • File
      tokenization_auto.py