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
06d940ef
Unverified
Commit
06d940ef
authored
Feb 08, 2023
by
Nicolas Patry
Committed by
GitHub
Feb 08, 2023
Browse files
Fixing backward compatiblity `image_processor` in pipeline. (#21513)
parent
8ea994d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/transformers/pipelines/__init__.py
src/transformers/pipelines/__init__.py
+4
-0
No files found.
src/transformers/pipelines/__init__.py
View file @
06d940ef
...
@@ -861,6 +861,10 @@ def pipeline(
...
@@ -861,6 +861,10 @@ def pipeline(
image_processor
=
model_name
image_processor
=
model_name
elif
isinstance
(
config
,
str
):
elif
isinstance
(
config
,
str
):
image_processor
=
config
image_processor
=
config
# Backward compatibility, as `feature_extractor` used to be the name
# for `ImageProcessor`.
elif
feature_extractor
is
not
None
and
isinstance
(
feature_extractor
,
BaseImageProcessor
):
image_processor
=
feature_extractor
else
:
else
:
# Impossible to guess what is the right image_processor here
# Impossible to guess what is the right image_processor here
raise
Exception
(
raise
Exception
(
...
...
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