Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
fd10d79b
Commit
fd10d79b
authored
Aug 30, 2019
by
thomwolf
Browse files
update GPT2 docstring
parent
abe734ca
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
pytorch_transformers/tokenization_gpt2.py
pytorch_transformers/tokenization_gpt2.py
+4
-1
No files found.
pytorch_transformers/tokenization_gpt2.py
View file @
fd10d79b
...
@@ -99,7 +99,10 @@ def get_pairs(word):
...
@@ -99,7 +99,10 @@ def get_pairs(word):
class
GPT2Tokenizer
(
PreTrainedTokenizer
):
class
GPT2Tokenizer
(
PreTrainedTokenizer
):
"""
"""
GPT-2 BPE tokenizer. Peculiarities:
GPT-2 BPE tokenizer. Peculiarities:
- Byte-level BPE
- Byte-level Byte-Pair-Encoding
- Requires a space to start the input string => will add a space is there isn't.
As a consequence, this tokenizer `encode` and `decode` method will not conserve
the absence of a space at the beginning of a string: `tokenizer.decode(tokenizer.encode("Hello")) = " Hello"
"""
"""
vocab_files_names
=
VOCAB_FILES_NAMES
vocab_files_names
=
VOCAB_FILES_NAMES
pretrained_vocab_files_map
=
PRETRAINED_VOCAB_FILES_MAP
pretrained_vocab_files_map
=
PRETRAINED_VOCAB_FILES_MAP
...
...
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