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
117a0f6a
Unverified
Commit
117a0f6a
authored
Apr 07, 2023
by
Arthur
Committed by
GitHub
Apr 07, 2023
Browse files
Small nit, (#22653)
* Small nit, Fixes #21986 * Update src/transformers/pipelines/__init__.py
parent
fc1ba6fd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
src/transformers/pipelines/__init__.py
src/transformers/pipelines/__init__.py
+2
-2
No files found.
src/transformers/pipelines/__init__.py
View file @
117a0f6a
...
...
@@ -788,7 +788,6 @@ def pipeline(
model_config
=
model
.
config
hub_kwargs
[
"_commit_hash"
]
=
model
.
config
.
_commit_hash
load_tokenizer
=
type
(
model_config
)
in
TOKENIZER_MAPPING
or
model_config
.
tokenizer_class
is
not
None
load_feature_extractor
=
type
(
model_config
)
in
FEATURE_EXTRACTOR_MAPPING
or
feature_extractor
is
not
None
load_image_processor
=
type
(
model_config
)
in
IMAGE_PROCESSOR_MAPPING
or
image_processor
is
not
None
...
...
@@ -871,7 +870,8 @@ def pipeline(
tokenizer_kwargs
=
tokenizer
[
1
]
else
:
tokenizer_identifier
=
tokenizer
tokenizer_kwargs
=
model_kwargs
tokenizer_kwargs
=
model_kwargs
.
copy
()
tokenizer_kwargs
.
pop
(
"torch_dtype"
,
None
)
tokenizer
=
AutoTokenizer
.
from_pretrained
(
tokenizer_identifier
,
use_fast
=
use_fast
,
_from_pipeline
=
task
,
**
hub_kwargs
,
**
tokenizer_kwargs
...
...
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