Declare __len__ method in PreTrainedTokenizerBase (#21210)
This commit is contained in:
@@ -1578,6 +1578,9 @@ class PreTrainedTokenizerBase(SpecialTokensMixin, PushToHubMixin):
|
|||||||
f" special_tokens={self.special_tokens_map_extended})"
|
f" special_tokens={self.special_tokens_map_extended})"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __len__(self) -> int:
|
||||||
|
raise NotImplementedError()
|
||||||
|
|
||||||
def get_vocab(self) -> Dict[str, int]:
|
def get_vocab(self) -> Dict[str, int]:
|
||||||
"""
|
"""
|
||||||
Returns the vocabulary as a dictionary of token to index.
|
Returns the vocabulary as a dictionary of token to index.
|
||||||
|
|||||||
Reference in New Issue
Block a user