File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
src/transformers/pipelines Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -909,16 +909,8 @@ def pipeline(
909
909
or model_config .tokenizer_class is not None
910
910
or isinstance (tokenizer , str )
911
911
)
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
922
914
923
915
# If `model` (instance of `PretrainedModel` instead of `str`) is passed (and/or same for config), while
924
916
# `image_processor` or `feature_extractor` is `None`, the loading will fail. This happens particularly for some
You can’t perform that action at this time.
0 commit comments