Skip to content

Commit 908a34e

Browse files
committed
Reverting load_feature_extractor and load_image_processor
1 parent 5821cfd commit 908a34e

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/transformers/pipelines/__init__.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -909,16 +909,8 @@ def pipeline(
909909
or model_config.tokenizer_class is not None
910910
or isinstance(tokenizer, str)
911911
)
912-
load_feature_extractor = (
913-
type(model_config) in FEATURE_EXTRACTOR_MAPPING
914-
or feature_extractor is not None
915-
or isinstance(feature_extractor, str)
916-
)
917-
load_image_processor = (
918-
type(model_config) in IMAGE_PROCESSOR_MAPPING
919-
or image_processor is not None
920-
or isinstance(image_processor, str)
921-
)
912+
load_feature_extractor = type(model_config) in FEATURE_EXTRACTOR_MAPPING or feature_extractor is not None
913+
load_image_processor = type(model_config) in IMAGE_PROCESSOR_MAPPING or image_processor is not None
922914

923915
# If `model` (instance of `PretrainedModel` instead of `str`) is passed (and/or same for config), while
924916
# `image_processor` or `feature_extractor` is `None`, the loading will fail. This happens particularly for some

0 commit comments

Comments
 (0)