Unverified Commit 7419d807 authored by Thomas Wang's avatar Thomas Wang Committed by GitHub
Browse files

Declare __len__ method in PreTrainedTokenizerBase (#21210)

parent ef530175
......@@ -1578,6 +1578,9 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
f" special_tokens={self.special_tokens_map_extended})"
)
def __len__(self) -> int:
raise NotImplementedError()
def get_vocab(self) -> Dict[str, int]:
"""
Returns the vocabulary as a dictionary of token to index.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment