-
Notifications
You must be signed in to change notification settings - Fork 27.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revert to rescale and safely handle flag in owlvit config #18750
Revert to rescale and safely handle flag in owlvit config #18750
Conversation
The documentation is not available anymore as the PR was closed or merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! And sorry about the double PR to revert the changes
if "rescale" in kwargs: | ||
rescale_val = kwargs.pop("rescale") | ||
kwargs["do_rescale"] = rescale_val | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Will we eventually remove this part?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. I think we can leave it for a short period of time so that if anyone pushes to the hub and updates the model, pushing the feature extractor with it, then the rescale
parameter will be renamed in the preprocessor_config.json
. After that, we could add a warning if rescale
is in detected in the config - asking the person to update their config as it will no longer be supported as a flag in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Thanks for handling the backwards compatibility @amyeroberts
What does this PR do?
Reverts the
rescale_image
method name to back torescale
. This keeps the method inline with other method names such asnormalize
.This undoes the renaming in #18677 done to address failing tests caused by
rescale
key being in OWL-ViT config and the introduction of arescale
method in #18499.The OWL-ViT config has since been updated. As the model has been released, we rename the key in the config in case
rescale
is there for backwards compatibility.Before submitting
Pull Request section?
to it if that's the case.
documentation guidelines, and
here are tips on formatting docstrings.