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
825697ca
"sims/vscode:/vscode.git/clone" did not exist on "d0f63f205066cb0b21467186da7fda0f15a94d25"
Commit
825697ca
authored
Dec 20, 2019
by
thomwolf
Browse files
fix tests
parent
1fa93ca1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
transformers/pipelines.py
transformers/pipelines.py
+2
-3
No files found.
transformers/pipelines.py
View file @
825697ca
...
...
@@ -32,7 +32,6 @@ from transformers import (AutoConfig, AutoTokenizer, PreTrainedTokenizer,
PretrainedConfig
,
ModelCard
,
SquadExample
,
squad_convert_examples_to_features
,
is_tf_available
,
is_torch_available
,
BasicTokenizer
,
ALL_PRETRAINED_MODEL_ARCHIVE_MAP
,
ALL_PRETRAINED_CONFIG_ARCHIVE_MAP
)
if
is_tf_available
():
...
...
@@ -845,9 +844,9 @@ def pipeline(task: str, model: Optional = None,
# Try to infer tokenizer from model or config name (if provided as str)
if
tokenizer
is
None
:
if
isinstance
(
model
,
str
)
and
model
in
ALL_PRETRAINED_
MODEL
_ARCHIVE_MAP
:
if
isinstance
(
model
,
str
)
and
model
in
ALL_PRETRAINED_
CONFIG
_ARCHIVE_MAP
:
tokenizer
=
model
elif
isinstance
(
config
,
str
)
and
model
in
ALL_PRETRAINED_CONFIG_ARCHIVE_MAP
:
elif
isinstance
(
config
,
str
)
and
config
in
ALL_PRETRAINED_CONFIG_ARCHIVE_MAP
:
tokenizer
=
config
else
:
# Impossible to guest what is the right tokenizer here
...
...
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