Skip to content
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

Make size_dict conversion logs clearer #20205

Merged

Conversation

amyeroberts
Copy link
Collaborator

@amyeroberts amyeroberts commented Nov 14, 2022

What does this PR do?

  • Tidies up logic for converting size parameter to the expected dictionary format for image processors.
  • Adds param_name as a flag so logs reflect the variable being updated e.g. crop_size versus size

Address part of #20185 - trying to make the logs clearer.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you read the contributor guideline,
    Pull Request section?
  • Was this discussed/approved via a Github issue or the forum? Please add a link
    to it if that's the case.
  • Did you make sure to update the documentation with your changes? Here are the
    documentation guidelines, and
    here are tips on formatting docstrings.
  • Did you write any new necessary tests?

@amyeroberts
Copy link
Collaborator Author

@sgugger @patrickvonplaten The quickest and easiest remedy I had was adding a param_name flag for the get_size_dict function. This way, if an image processor has both size and crop_size variables being updated, the logs reflect the parameter being changed. However, it's a bit of a dirty trick. LMK if you have an alternative suggestion.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up!

@amyeroberts amyeroberts force-pushed the make-size-dict-message-clearer branch from 2eeda1e to c07fa56 Compare November 15, 2022 09:59
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

@amyeroberts amyeroberts merged commit 55ba319 into huggingface:main Nov 15, 2022
@amyeroberts amyeroberts deleted the make-size-dict-message-clearer branch November 15, 2022 10:53
@patrickvonplaten
Copy link
Contributor

Thanks!

mpierrau pushed a commit to mpierrau/transformers that referenced this pull request Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants