Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
7419d807
Unverified
Commit
7419d807
authored
Jan 20, 2023
by
Thomas Wang
Committed by
GitHub
Jan 20, 2023
Browse files
Declare __len__ method in PreTrainedTokenizerBase (#21210)
parent
ef530175
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/tokenization_utils_base.py
src/transformers/tokenization_utils_base.py
+3
-0
No files found.
src/transformers/tokenization_utils_base.py
View file @
7419d807
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment