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
bb044462
"examples/vscode:/vscode.git/clone" did not exist on "25a50f1a37e7b2eea3479fb9a78c8847883f2552"
Unverified
Commit
bb044462
authored
Aug 20, 2019
by
Guillem García Subies
Committed by
GitHub
Aug 20, 2019
Browse files
Update tokenization_openai.py
parent
bfd75056
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
pytorch_transformers/tokenization_openai.py
pytorch_transformers/tokenization_openai.py
+3
-3
No files found.
pytorch_transformers/tokenization_openai.py
View file @
bb044462
...
...
@@ -89,9 +89,9 @@ class OpenAIGPTTokenizer(PreTrainedTokenizer):
try
:
import
ftfy
import
spacy
self
.
nlp
=
spacy
.
load
(
'en'
,
disable
=
[
'parser'
,
'tagger'
,
'ner'
,
'textcat'
]
)
self
.
fix_text
=
ftfy
.
fix_text
from
spacy.lang.en
import
English
_
nlp
=
English
(
)
self
.
nlp
=
nlp
.
Defaults
.
create_tokenizer
(
_nlp
)
except
ImportError
:
logger
.
warning
(
"ftfy or spacy is not installed using BERT BasicTokenizer instead of SpaCy & ftfy."
)
self
.
nlp
=
BasicTokenizer
(
do_lower_case
=
True
)
...
...
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