"vscode:/vscode.git/clone" did not exist on "fdaef3368b7495f6d3f26739fece0ee370fa7ce6"
Unverified Commit 06d940ef authored by Nicolas Patry's avatar Nicolas Patry Committed by GitHub
Browse files

Fixing backward compatiblity `image_processor` in pipeline. (#21513)

parent 8ea994d3
...@@ -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(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment